Invalid root in registry_key error

B

bf5aqaw

Getting this error running an application on windows2000 ..
C:\AMDIR\V0806\vsell.js(123.2) WshShell.RegRead: Invalid root in registry_key
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\msdev.exe\Path"

any info on this..

Thanks
cw
 
D

Dave Patrick

I've really no idea there but at the very basic level the script is flawed.



--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
 
J

Jon Wallace

Hello,

There may be a couple of things here,

Firstly, when you use the wshshell.regread function in VBScript your root
keys should be abriviated - i.e. HKLM for HKEY_LOCAL_MACHINE so in your
case, your script would look something like this...

---

DIM WshShell
SET WshShell = CreateObject("WScript.Shell")

DIM Value
Value = WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Shared
Tools\msdev.exe\Path", "REG_SZ")

---

Now that is assuming that Path is actually a value and of the type REG_SZ -
obviously you can't read 'keys'...

Secondly, the path your trying to read may not exist
SOFTWARE\Microsoft\Shared Tools\msdev.exe\Path although I would expect a
different error.

Finally, I would add given your comment about restarting IIS - are you
trying to do this in ASP or straight VBScript - the reason being is that the
owner (account) of the IIS processes may not have permissions to read the
relevent values...

If it's VBScript then I suspect it's just a matter of changing
HKEY_LOCAL_MACHINE to HKLM

Cheers,
Jon

http://www.insidetheregistry.com

Registry Tips - http://www.insidetheregistry.com/regtips/browse.asp
 
J

Jon Wallace

Hello,

There may be a couple of things here,

Firstly, when you use the wshshell.regread function in VBScript your root
keys should be abriviated - i.e. HKLM for HKEY_LOCAL_MACHINE so in your
case, your script would look something like this...

---

DIM WshShell
SET WshShell = CreateObject("WScript.Shell")

DIM Value
Value = WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Shared
Tools\msdev.exe\Path", "REG_SZ")

---

Now that is assuming that Path is actually a value and of the type REG_SZ -
obviously you can't read 'keys'...

Secondly, the path your trying to read may not exist
SOFTWARE\Microsoft\Shared Tools\msdev.exe\Path although I would expect a
different error.

Finally, I would add given your comment about restarting IIS - are you
trying to do this in ASP or straight VBScript - the reason being is that the
owner (account) of the IIS processes may not have permissions to read the
relevent values...

If it's VBScript then I suspect it's just a matter of changing
HKEY_LOCAL_MACHINE to HKLM

Cheers,
Jon

http://www.insidetheregistry.com

Registry Tips - http://www.insidetheregistry.com/regtips/browse.asp
 

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