Here is what I have so far and I only tested on NT 4.0 and Win2K and neither work........

@ECHO
IF NOT "%OS%" == "Windows_NT" GOTO WIN9X
VER|FIND /I "XP" >NUL && IF %ERRORLEVEL% EQU 0 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
use s: "\\fsga01\administration\it\docs"
GOTO END

:NT4
ECHO Found Windows NT 4
if ingroup("test2")
Use * /delete /Persistent:Yes
shell "SUBST N: /D"
shell "SUBST N: \\fsga01\administration\it"
use m: "\\fsga01\administration"
GOTO END

:WIN9X
ECHO Found Windows 9x
REM Or what ever command you want to run.
GOTO END

:END