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:
00875914
Vues:
16
Glad it works for you. It was fun looking at batch files again. I enjoyed researching it. It's hard to believe I used to spend a lot of time writing them years ago yet I haven't looked at anything close to what I used to do in over 2 years!


>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
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform