Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for kixassoc.bat

(view source code of kixassoc.bat as plain text)

  1. @ECHO OFF
  2. :: KixAssoc.bat,  Version 2.00 for Windows NT
  3. :: Define a file type and association for Kix scripts and add
  4. :: the .KIX extension to the environment variable PATHEXT.
  5. :: Written by Rob van der Woude
  6. :: http://www.robvanderwoude.com
  7.  
  8. SETLOCAL
  9. ECHO.
  10. ASSOC .kix=KixScript
  11. FTYPE KixScript=KIX32.EXE %%1 %%*
  12. SET Added=0
  13. FOR %%A IN (%PathExt%) DO IF /I "%%A"==".KIX" SET Added=1
  14. IF "%Added%"=="0" SET PATHEXT=%PATHEXT%;.KIX
  15. (ECHO REGEDIT4)>%Temp%.\KixAssoc.reg
  16. (ECHO.)>>%Temp%.\KixAssoc.reg
  17. (ECHO [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment])>>%Temp%.\KixAssoc.reg
  18. (ECHO "PATHEXT"="%PathExt%")>>%Temp%.\KixAssoc.reg
  19. REGEDIT /S %Temp%.\KixAssoc.reg
  20. DEL %Temp%.\KixAssoc.reg
  21. ECHO.
  22. ECHO The .KIX extension has been added to the environment variable PATHEXT.
  23. ECHO This means you no longer have to type the .KIX extension to start the
  24. ECHO Kix script, just like typing COMMAND is enough to start COMMAND.COM.
  25. ECHO However, since PATHEXT is a HKEY_LOCAL_MACHINE registry setting this
  26. ECHO change won't take effect until you reboot the system.
  27. ENDLOCAL
  28.  

page last modified: 2024-04-16; loaded in 0.0067 seconds