bla!!
Daemon Poster
- Messages
- 1,118
- Location
- /usr/root/mn/us
Hi, I'm trying to write a batch file that will execute different commands depending on what OS it's run on.
Can anyone help me with a way to identify the OS's.
In DOS you can type ver to get what OS version it is, but how would you compare that to say a string or a value?
Here's the basics of what I want to do.
IF OSVER == WinXP GOTO ONE
IF OSVER == Win2k GOTO TWO
IF OSVER == WinNT GOTO THREE
GOTO END
:ONE
execute registry entry for XP
GOTO END
:TWO
execute registry entry for 2k
GOTO END
:THREE
execute registry entry for NT4.0
:END
PAUSE
I found a way through novell, but not all users have novell logons, so I was wondering if there was a variable or a way to transfer the value of "ver" into a string so I can compare it to something else.
Can anyone help me with a way to identify the OS's.
In DOS you can type ver to get what OS version it is, but how would you compare that to say a string or a value?
Here's the basics of what I want to do.
IF OSVER == WinXP GOTO ONE
IF OSVER == Win2k GOTO TWO
IF OSVER == WinNT GOTO THREE
GOTO END
:ONE
execute registry entry for XP
GOTO END
:TWO
execute registry entry for 2k
GOTO END
:THREE
execute registry entry for NT4.0
:END
PAUSE
I found a way through novell, but not all users have novell logons, so I was wondering if there was a variable or a way to transfer the value of "ver" into a string so I can compare it to something else.