reg.exe script error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all -

I'm creating a script to push out Hotfixes on our closed network. I burn
the hotfixes to a cd and then load them on a fixed location on our network.
The problem that I'm having is on our Windows XP client machines. I try to
query the registry to determine if the hotfix has already been installed.
However when I use the reg.exe query command, I get the following message
whether or not the registry key is actually there.

Error: The system was unable to find the specified registry key or value

I used regedit to make sure that the key exists and I ensured that
permissions were open for the users to see the key. Our XP machines have SP1
installed. Installing SP2 is not an option for us at this point as we are
still testing it prior to its application on our production network.

I appreciate any help you can give.

Chris
 
Thanks Wes. I saw this prior to my post and removed a /s parameter that I
was using, but it didn't change my result. Still no dice on reading that key
from the registry.
 
Chris,

Pls post the entire REG command-line. Or, use this VBScript to query the
list of installed Hotfixes, using WMI

-----------------------------------------------
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

On Error Resume Next

Set shell = CreateObject("Wscript.Shell")
Set fso = Wscript.CreateObject("Scripting.FilesystemObject")
set b = fso.CreateTextFile("C:\FixList.txt",true)
b.writeline "List of Hotfixes installed in this computer"
b.writeblanklines 1

strComputer="."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM
Win32_QuickFixEngineering", "WQL", _
wbemFlagReturnImmediately +
wbemFlagForwardOnly)
For Each objItem In colItems
b.writeline objItem.HotFixID
Next

b.close
shell.Run "notepad C:\FixList.txt", 1,True
set shell = Nothing
set fso = Nothing
 
Watch for line wrap. Better, download the attached file qfe.vb. Download and
rename as qfe.vbs
 
Actual line in batch file is \\server1\utils\reg.exe query
"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows
XP\Updates\SP3\KB890047\Description".

On our Win2K boxes this returns the data and type of the key, but it says it
cannot read the Win XP registry. Same result on all our XP machines, so it's
not specific to one machine.

Thanks.

Chris
 
Chris,

As XP has the REG.EXE built-in, in one of theXP machines try running the
command without the \\server\utils\ path.
 
I guess this is where you want to check:

HKLM\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB834707

Here is the correct syntax: (mention /v for value)

REG QUERY "HKLM\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KBnnnnnn" /v
"Description"
 
Back
Top