It is telling me "Invalid root in registry key".

Thanks in advance...
Brian

-----Original Message-----
From: Morgan, Joshua [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 19, 2002 11:32 AM
To: NT 2000 Discussions
Subject: RE: Check registry key with script
Sensitivity: Private


If you manually run the script from the command line where does it fail?

-----Original Message-----
From: Lich, Brian M. [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, March 19, 2002 11:28 AM
To: NT 2000 Discussions
Subject: Check registry key with script
Sensitivity: Private


Hello:

I am by no means a scripting guru.  I am trying to write a vbscript to use
as a startup script in Win2k AD on Windows 2000 Professional machines.
Basically I would like this script to check to see if a registry key exists.
If so I would like it to end, otherwise it should install a hotfix.  I have
included the script below.  

I cannot get this to work.  Can you even do this with hotfix.exe?

Any help would be appreciated.


Option Explicit

Dim oShell, oNet, oFSO, oWshNetwork, oGroupDict, CRLF, svalue

CRLF = Chr(13) & Chr(10)
Set oShell = CreateObject("Wscript.Shell")
Set oNet   = CreateObject("Wscript.Network")
set oFSO   = CreateObject("Scripting.FileSystemObject")

On Error Resume Next
sValue = oShell.RegRead("HKLM\Software\Microsoft\Windows NT\Current
Version\HotFix\Q300845\")

if Err.Number = 0 then
  oshell.run ("\\server\apps\microsoft\hotfix\Q300845\hotfix -m -q -z") End
if

Thank you...

Brian Lich
Network Administrator and Systems Coordinator
Indiana University School of Dentistry
1121 West Michigan St.  DS-120
Indianapolis, IN 46202


------
You are subscribed as [EMAIL PROTECTED]
Archives: http://www.swynk.com/sitesearch/search.asp
To unsubscribe send a blank email to %%email.unsub%%

------
You are subscribed as [EMAIL PROTECTED]
Archives: http://www.swynk.com/sitesearch/search.asp
To unsubscribe send a blank email to %%email.unsub%%

------
You are subscribed as [email protected]
Archives: http://www.swynk.com/sitesearch/search.asp
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to