Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for netsetus.bat

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

  1. @ECHO OFF
  2. REM Stores computername, user ID and Workgroup in environment
  3. REM variables COMPUTERNAME, USERNAME and WORKGROUP in Windows
  4. REM 98's master environment.
  5. REM Uses WINSET, which must be located somewhere in the PATH.
  6. REM This batch file is adapted for English Windows 98 versions.
  7.  
  8. NET CONFIG | FIND /I "Computer name" > %TEMP%.\NETCONF$.BAT
  9. ECHO > COMPUTER.BAT WINSET COMPUTERNAME=%%2
  10. CALL %TEMP%.\NETCONF$.BAT
  11.  
  12. NET CONFIG | FIND /I "User name" > %TEMP%.\NETCONF$.BAT
  13. ECHO > USER.BAT WINSET USERNAME=%%2
  14. CALL %TEMP%.\NETCONF$.BAT
  15.  
  16. NET CONFIG | FIND /I "Workgroup" > %TEMP%.\NETCONF$.BAT
  17. ECHO > WORKGROUP.BAT WINSET WORKGROUP=%%1
  18. CALL %TEMP%.\NETCONF$.BAT
  19.  
  20. DEL USER.BAT
  21. DEL COMPUTER.BAT
  22. DEL WORKGROUP.BAT
  23. DEL %TEMP%.\NETCONF$.BAT
  24.  

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