Value or registry key to identify SP2 installation?

Posted: 03-19-2005, 03:07 AM
Using a variable in a logon script, is there a value or a registry key that
I can query which will tell me whether an XP computer has SP2 installed?


Value or registry key to identify SP2 installation?


Responses to "Value or registry key to identify SP2 installation?"

Pegasus \(MVP\)
Guest
Posts: n/a
 
Re: Value or registry key to identify SP2 installation?
Posted: 03-19-2005, 09:54 AM

"Jeff Karasik" <jkarasik@yahoo.com> wrote in message
news:%23xft%23CDLFHA.2804@TK2MSFTNGP10.phx.gbl...
> Using a variable in a logon script, is there a value or a registry key
that
> I can query which will tell me whether an XP computer has SP2 installed?
>
You could use psinfo.exe (www.sysinternals.com).


Wesley Vogel
Guest
Posts: n/a
 
Re: Value or registry key to identify SP2 installation?
Posted: 03-19-2005, 01:13 PM
I do not have SP2 so I can't narrow it down any more than...

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Wind ows XP\SP2 or SP3

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In news:%23xft%23CDLFHA.2804@TK2MSFTNGP10.phx.gbl,
Jeff Karasik <jkarasik@yahoo.com> hunted and pecked:
> Using a variable in a logon script, is there a value or a registry
> key that I can query which will tell me whether an XP computer has
> SP2 installed?
Claude Henchoz
Guest
Posts: n/a
 
Re: Value or registry key to identify SP2 installation?
Posted: 03-19-2005, 08:26 PM
Put the following inside a text file and call it whatever.vbs:

-----------------------------------------
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_OperatingSystem",,48)
For Each objItem in colItems
Wscript.Echo objItem.ServicePackMajorVersion
Next
-----------------------------------------

If your logon script is a batch file, you may then call this script
from it to set an environment variable like this:

----------------------------------------
@ECHO OFF
FOR /F %%G IN ('cscript /NoLogo whatever.vbs') DO SET SP_LEVEL=%%G
ECHO Your Service Pack level is %SP_LEVEL%
----------------------------------------

Hope this helps.

Cheers, Claude

Jeff Karasik
Guest
Posts: n/a
 
Re: Value or registry key to identify SP2 installation?
Posted: 03-22-2005, 02:37 AM
Thanks to all for your advice and assistance.
jsk
"Claude Henchoz" <claude.henchoz@gmail.com> wrote in message
news:1111263996.985279.42000@l41g2000cwc.googlegro ups.com...
> Put the following inside a text file and call it whatever.vbs:
>
> -----------------------------------------
> On Error Resume Next
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:\\" & strComputer &
> "\root\cimv2")
> Set colItems = objWMIService.ExecQuery("Select * from
> Win32_OperatingSystem",,48)
> For Each objItem in colItems
> Wscript.Echo objItem.ServicePackMajorVersion
> Next
> -----------------------------------------
>
> If your logon script is a batch file, you may then call this script
> from it to set an environment variable like this:
>
> ----------------------------------------
> @ECHO OFF
> FOR /F %%G IN ('cscript /NoLogo whatever.vbs') DO SET SP_LEVEL=%%G
> ECHO Your Service Pack level is %SP_LEVEL%
> ----------------------------------------
>
> Hope this helps.
>
> Cheers, Claude
>

 
LinkBack Thread Tools Display Modes
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is registry saved on installation? Blacksmith Windows XP Setup 2 01-13-2004 04:15 AM
Identify Registry Software Folders JD Windows XP Help & Support 4 12-16-2003 06:17 PM
cannot write to registry-installation of programs tom lorenzini Windows XP Security & Administration 0 09-30-2003 10:00 PM
Installation Path in Registry? David Windows XP 0 09-01-2003 06:50 AM
How can I get a copy of the REGISTRY previous to an installation of an app? Oswaldo Santos Windows XP Performance & Maintenance 2 07-22-2003 03:44 PM