Re: Retrieving Service Pack version from DOS
From: Torgeir Bakken (MVP) (Torgeir.Bakken-spam_at_hydro.com)
Date: 02/28/04
- Next message: NobodyMan: "Re: Oops"
- Previous message: NobodyMan: "Re: e-mail attachments"
- In reply to: anonymous_at_discussions.microsoft.com: "Retrieving Service Pack version from DOS"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 28 Feb 2004 04:14:08 +0100
anonymous@discussions.microsoft.com wrote:
> I am writing a diagnostic batch file for my company and I
> know the ver will give the operating system, but is there
> a command that will give the service pack that is
> installed?
Hi
Try this batch file (watch for line wrap, the two reg.exe callout
lines are 123 characters long):
--------------------8<----------------------
@echo off
set SPLevel=0
Reg.exe QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CSDVersion | FIND/I "Service Pack 1" && set SPLevel=1
Reg.exe QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CSDVersion | FIND/I "Service Pack 2" && set SPLevel=2
cls
echo.
echo Service pack level: %SPLevel%
echo.
pause
--------------------8<----------------------
Some external command line based free utilities that also
are able to help you:
The free OSVer.exe in the "Admin Script Tools" at
http://home.comcast.net/~stewartb/wast.html
<quote>
OSVER allows a batch file to perform operating system platform checking. It
can differentiate between Windows 95, Windows 98, Windows Me, Windows NT
4.0, Windows 2000, Windows XP, and Windows Server 2003. For NT-based
systems, it can also return the system's service pack level and role (e.g.
workstation, server, or domain controller). For Windows NT 4.0 SP6 and
later, it can also detect whether the system is a Terminal Server (either
remote administration mode or application server mode).
<quote>
Some other free command line utilities that can obtain a lot
of information on local and remote computers:
A)
PSInfo, for local and remote computers.
PSInfo.exe is in the in the free PsTools suite found at
http://www.sysinternals.com/
B)
Here is another one:
Console Computer Information Utility for 2000/XP
http://www.beyondlogic.org/solutions/compinfo/compinfo.htm
Use it in conjunction with BeyondExec (from same Web site) to get details of
remote computers. Beyondexec also have multiple computer functionality.
C)
For the ultimate tool in information gathering, you have AIDA32 (free):
http://www.aida32.hu/aida32.php
It can do automatic audit (e.g. using a logon script) via command-line
switches and save results to a file in various formats like HTML, CSV
or XML, or put it in a database (it has ADO/ODBC database support)
5.1 Command-line Mode
http://www.aida32.hu/proguide/en/proguide.htm#commandline_mode
AIDA32 network audit in practice
http://www.aida32.hu/aida-articles.php?n=002&lang=en
Using SQL databases for AIDA32.
http://www.aida32.hu/aida-articles.php?n=003&lang=en
-- torgeir Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: http://www.microsoft.com/technet/scriptcenter
- Next message: NobodyMan: "Re: Oops"
- Previous message: NobodyMan: "Re: e-mail attachments"
- In reply to: anonymous_at_discussions.microsoft.com: "Retrieving Service Pack version from DOS"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|