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:
00875847
Vues:
20
Hi Bruce,

Then maybe something like:
SET OutlookExpDir=%ProgramFiles%\Outlook Express
SET ErrorDescr=Directory %OutlookExpDir% not found
IF NOT EXIST "%OutlookExpDir%" GOTO Error

:Error
ECHO.
ECHO The process encountered at least one error:
ECHO.%ErrorDescr%
ECHO The batch process has aborted.
or
SET ArchiveDir=%ProgramFiles%\OutlookUninstArchive
IF NOT EXIST "%ArchiveDir%" MD "%ArchiveDir%"
SET ErrorDescr=Directory %ArchiveDir% could not be created
IF NOT EXIST "%ArchiveDir%" GOTO Error

:Error
ECHO.
ECHO The process encountered at least one error:
ECHO.%ErrorDescr%
ECHO The batch process has aborted.
>>The problem is that NT, 2K, and XP all have the same value for %OS%:
>>Try the below .bat file:
>>
>>set ostype=DOS
>>IF %OS%==Windows_NT SET ostype=WinNT
>>set
>>
>>You might try here:
>>
>>http://www.robvanderwoude.com/index.html
>>
>>Cool examples anyway...
>
>Thanks Tracy, for the code & link. I'm home with no NT now, but the BAT I created with your code ran fine on XP.
>
>This shows up with the SET command, which also has a whole bunch of other info that might be usable.
>
>In fact, maybe I'm going about this the hard way. All I really need is one distinguishing feature to check for (a certain folder or file, e.g.) common to NT only (or XP only), and then the default install (the "else") would be the other OS.
>
>That'll be my fallback position, but first I'm gonna read through the link, see what I might find there. Thanks!
.·*´¨)
.·`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
Répondre
Fil
Voir

Click here to load this message in the networking platform