Hello chaicka,Please give this a try and let me know how it goes.
The following code can be used to find the current release version of Windows XP from a batch file. This may need to be altered for other non English languages and/or when XP is updated.
NOTE:
The line to check for Windows 9x must be first otherwise you'll get an error because Windows 9x does not understand the FOR command as used here
code:
@ECHO OFF
IF NOT "%OS%" == "Windows_NT" GOTO WIN9X
for /f "Tokens=*" %%i in ('ver') do ( IF "%%i" == "Microsoft Windows XP [Version 5.1.2600]" GOTO XP)
IF not "%ALLUSERSPROFILE%" == "" GOTO WIN2K
IF "%OS%" == "Windows_NT" GOTO NT4
GOTO END:XP
ECHO Found Windows XP
REM Or what ever command you want to run.
GOTO END
:WIN2K
ECHO Found Windows 2000
REM Or what ever command you want to run.
GOTO END
:NT4
ECHO Found Windows NT 4
REM Or what ever command you want to run.
GOTO END
:WIN9X
ECHO Found Windows 9x
REM Or what ever command you want to run.
GOTO END
:END
Please post your test results. All my batch files still work in XP so I don't think it is something caused by XP.
[ 06 November 2001: Message edited by: NTDOC ]