Advertisement
Guest User

Windows Batch Script 03 For Portable HexChat & Portable Perl

a guest
Nov 27th, 2014
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. @echo off
  2. @rem A windows batch/cmd script to run HexChat from USB/Portable drive, with
  3. @rem portable perl support. HexChat IRC Client/communication software.
  4. @rem HexChat is based on XChat software.
  5. @rem This script will also allow to run a second/2nd instance of HexChat.
  6. @rem When installing HexChat, you must select "Portable" option,
  7. @rem if you want to run HexChat from a USB drive or from your own choice of
  8. @rem folder, which will not conflict with existing 1st/main HexChat.
  9. @rem Copy & paste these codes into a file, name the file HexChat-USB.cmd
  10. @rem You must place the file next to hexchat.exe file, inside HexChat folder.
  11. @rem Download Strawberry Perl : if hexchat includes perl interface interpreter
  12. @rem for version 5.20, then get strawberry PORTABLE ZIP file version 5.20
  13. @rem If "HexChat" is in this E:\ location (E:\HexChat\), then create
  14. @rem a "Perl" folder next to it, means, create a "Perl" folder in same
  15. @rem prefix location, in E:\ So in end, "Perl" will be E:\Perl\
  16. @rem Decompress strawberry perl zip file inside E:\Perl\
  17. @rem You may use 7zip, or Windows default zip extraction.
  18. @rem So in end, perl.exe file will have to be here E:\Perl\perl\bin\
  19. @rem Double click on HexChat-USB.cmd file, to start HexChat, from USB.
  20. @rem No copyright. For anyone to use anywhere. by tErik.
  21.  
  22. setlocal
  23.  
  24. @rem echo %~dp0
  25. @rem E:\HexChat\
  26. set STARTPTH=%~dp0
  27. set PERLPATH=%STARTPTH%..\..\Perl\;%STARTPTH%..\..\Perl\perl\;%STARTPTH%..\..\Perl\perl\bin\
  28. set PATH=%STARTPTH%;%PERLPATH%;%PATH%
  29.  
  30. @rem Display environment variable values/content:
  31. @echo STARTPTH=%STARTPTH%
  32. @echo .
  33. @echo PERLPATH=%PERLPATH%
  34. @echo .
  35. @echo PATH=%PATH%
  36. @echo .
  37. @echo .
  38.  
  39. IF EXIST %STARTPTH%..\..\Perl\perl\bin\perl.exe GOTO perlFnd
  40.  
  41. :perlNfnd
  42. @echo ERROR: perl.exe file not found, (inside the "Perl" directory/folder
  43. @echo structure for portable use, which suppose to be placed next to "HexChat"
  44. @echo folder/directory). See "notes" inside HexChat-USB.cmd file.
  45. @echo .
  46. @echo HexChat is now executed to run, (without Portable Perl support,
  47. @echo and HexChat will try to use host system's Perl, if exists & specified
  48. @echo in host system's PATH environment variable, and if that perl version
  49. @echo is compatible with perl interface interpreter included with HexChat).
  50. GOTO StartHxc
  51.  
  52. :perlFnd
  53. @echo HexChat is now executed to run, (with custom/portable Perl support).
  54.  
  55. :StartHxc
  56. @echo .
  57. @echo When HexChat is closed, then, (or after HexChat starts up), this window will AUTO CLOSE AFTER 20 SECONDS.
  58. @echo .
  59.  
  60. @rem START "title" [/D path] [options] "command" [parameters]
  61.  
  62. @START "HexChat (Portable)" /D%STARTPTH% "hexchat.exe"
  63.  
  64. @rem CMD [charset] [options] [/K Command]
  65.  
  66. @rem %WINDIR%\system32\cmd.exe /C ""%%STARTPTH%%\hexchat.exe""
  67.  
  68. timeout 20
  69.  
  70. endlocal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement