Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OS check in a BAT
Message
Information générale
Forum:
Windows
Catégorie:
Configuration
Divers
Thread ID:
00875636
Message ID:
00875910
Vues:
24
Bingo, beautiful! I was trying to find a way to parse VER like Fred suggested, but you found the trick, Tracy. Testing, it works on NT, Win2K, XP, and probably will work on Win 2003 as well. That's all I need.

--Thanks much, Tracy, this is a major help for my SMS deployments.


>I think I found something that works:
>
>@ECHO OFF
>VER | FIND "Windows 9" >NUL
>IF NOT ERRORLEVEL 1 GOTO GO9
>
>VER | FIND "Windows NT" >NUL
>IF NOT ERRORLEVEL 1 GOTO GoNT
>
>VER | FIND "Windows 2000" >NUL
>IF NOT ERRORLEVEL 1 GOTO GO2K
>
>VER | FIND "Windows XP" >NUL
>IF NOT ERRORLEVEL 1 GOTO GOXP
>
>GOTO GOOUT
>
>:GO2K
>ECHO Windows 2000
>GOTO GOOUT
>
>:GOXP
>ECHO Windows XP
>GOTO GOOUT
>
>:GONT
>ECHO Windows NT
>GOTO GOOUT
>
>:GOOUT
>
>It seems to work on XP and 98 but I haven't tried it on any others...
>
>>I know I should know this, but I've long forgotten. I have a new temporary BAT that checks for NT or XP OS to do installs via SMS. How does the DOS OS check code work? Something like this, in pseudocode:
>>
>>If OS = NT install this
>>
>>If OS = XP install that
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform