Finding whether PC is Windows 2000 or Windows XP

  • Thread starter Thread starter Henry
  • Start date Start date
H

Henry

Is there any variable to check that we can use in a .bat
logon script that determines/checks whether the PC logging
in is a Windows XP or Windows 2000? Appreciate any help.
 
Henry said:
Is there any variable to check that we can use in a .bat
logon script that determines/checks whether the PC logging
in is a Windows XP or Windows 2000? Appreciate any help.

Maybe something like the following:

01. @echo off
02. ver | find "Windows 2000" > nul
03. if %errorlevel% equ 0 goto :W2K
04. ver | find "Windows XP" > nul
05. if %errorlevel% equ 0 goto :WXP
06. echo/This computer is not running either ^
07. Windows 2000 or Windows XP
08. goto :EOF
09. :W2k
10. echo/This computer is running Win2000.
11. goto :EOF
12. :WXP
13. echo/This computer is running WinXP.
14. goto :EOF
 
Back
Top