How to Find OS version.

D

DJ

All,

I need a batch file that will be able to determine what
version of windows is running on a box. I.E. Win2000 ,
WinXP, Winnt. Does anyone know how to do this.

My goal is to use this in conjunction with the new
security patch microsoft has just released. MS03-026. I
want to be able to use a batch file to determine the OS
version, then start the proper install .exe for that
version OS then reboot.

I can handle everything else, just need to know how to
find the os version.

Thanks.

D.J.
 
N

NuT CrAcKeR

I dont recommend scirpting this particular patch, as in my experience, it
does not like to run silently very well. the problem comes from letting the
patch handle the required reboot of the server.

On several occasions, I neglected to check the "do not reboot now" checkbox
on the confirmation window. In each case, the server hanged while trying to
shut down (at the blue-ish screen, just before the reboot actually occurs).

I had to physically visit these servers, and give them a hard power cycle.
Hence, we did several hundred servers via TerminalServices, and WE
controlled the reboot. This worked out just fine.

NuTs
 
S

Shaun

Don't know if this will help but
the command "ver" run at the the dos prompt
will show the version of Operating System !

Hope this will help
 
G

guard

DJ said:
I need a batch file that will be able to determine what
version of windows is running on a box...

The Mount/\Command "GetOS" provides the following:

1. Displays the current Operating System
2. Saves the value in the variable %#os%
3. Sets an errorlevel based on the result

GetOS performs CONSISTENTLY under NT/2K/XP/K3. It is included in the FREE
Advanced NT/2K/XP Command Library (http://ntlib.com)

See the GetOS Page for details and color-keyed examples:
(http://TheSystemGuard.com/MtCmds/GetValue/GetOS.htm)

*******

-tsg
____________________________________________________________
TheSystemGuard.com | BoomingOrFuming.com | MountCommands.com
Free and "Almost Free" Knowledge for Windows System Admins!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top