Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for whoami.bat

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

  1. @ECHO OFF
  2. :: WhoAmI
  3. :: NT clone of WhoAmI.cmd for OS/2
  4. :: Written by Rob van der Woude
  5. :: http://www.robvanderwoude.com
  6. ::
  7. VER | FIND "Windows" >NUL
  8. IF ERRORLEVEL 1 GOTO:EOF
  9. ::
  10. FOR /F "tokens=1* delims=." %%A IN ('VER ^| FIND "."') DO (SET MajorVer=%%A&SET MinorVer=%%B)
  11. FOR %%A IN (%majorver%) DO SET MajorVer=%%A
  12. FOR /F "tokens=1* delims=." %%A IN ('ECHO.%minorver%') DO SET MinorVer=%%A
  13. ::
  14. ECHO.
  15. ECHO Computer Name        :  \\%computername%
  16. ECHO User Id logged on    :  %username%
  17. ECHO LAN Group            :  %userdomain%
  18. ECHO Major version number :  %majorver%
  19. ECHO Minor version number :  %minorver%
  20. ECHO Logon domain         :  %userdomain%
  21. ECHO Other domains        :  -none-
  22.  

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