Powered by GeSHi

Source code for compname.bat

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

  1. @ECHO OFF
  2. :: Check if help is wanted
  3. ECHO.%1 | FIND "?" >NUL
  4. IF NOT ERRORLEVEL 1 GOTO Syntax
  5. :: Only one parameter required
  6. IF     [%1]==[] GOTO Syntax
  7. IF NOT [%2]==[] GOTO Syntax
  8. :: Check Windows version
  9. VER | FIND "Windows 9" >NUL
  10. IF ERRORLEVEL 1 GOTO Syntax
  11. :: Check if Kix script can be found
  12. IF NOT EXIST CompName.kix GOTO Syntax
  13.  
  14. :: Use accompanying Kix script to actually perform the job
  15. KIX32.EXE CompName.kix $NewName=%1
  16.  
  17. :: Done
  18. GOTO End
  19.  
  20. :Syntax
  21. ECHO.
  22. ECHO CompName.bat and CompName.kix,  Version 1.01 for Windows 9x
  23. ECHO Adjust ComputerName and HostName
  24. ECHO.
  25. ECHO Usage:  COMPNAME  new_computer_name
  26. ECHO.
  27. ECHO Note:   KIX32.EXE must be located either in the current directory or
  28. ECHO         somewhere in the PATH.
  29. ECHO         COMPNAME.KIX must be located in the current directory.
  30. ECHO.
  31. ECHO Written by Rob van der Woude
  32. ECHO http://www.robvanderwoude.com
  33.  
  34. :End
  35.