Discussion:
RegRead Error: invalid root in registry key
(too old to reply)
Toddm
2004-10-29 00:08:02 UTC
Permalink
I have an ASP Page that is reading the registry using the following VBScript:

'Get Environment value from Registry
Dim objShell, environment
Set objShell = Server.CreateObject("WScript.Shell")
environment = UCase(objShell.RegRead("HKLM\SOFTWARE\Chela
Financial\Environment\"))

The code was working and then I got the following error:

WshShell.RegRead error '80070006'
Invalid root in registry key "HKLM\SOFTWARE\Chela Financial\Environment\".

I restarted IIS and the code worked again.

Does anyone know what the problem is or the solution?

Thanks

Todd McClintock
name
2004-10-30 05:58:50 UTC
Permalink
What is passed the last slash ?

If there is nothing (value), what but an error do you expect ?

If nothing is supposed to be, you need to escape the 'error' nevertheless.
Post by Toddm
'Get Environment value from Registry
Dim objShell, environment
Set objShell = Server.CreateObject("WScript.Shell")
environment = UCase(objShell.RegRead("HKLM\SOFTWARE\Chela
Financial\Environment\"))
WshShell.RegRead error '80070006'
Invalid root in registry key "HKLM\SOFTWARE\Chela Financial\Environment\".
I restarted IIS and the code worked again.
Does anyone know what the problem is or the solution?
Thanks
Todd McClintock
Toddm
2004-11-06 00:06:02 UTC
Permalink
I'm using the following as the registry key:

"HKLM\SOFTWARE\Chela Financial\Environment\"

There is nothing after the last slash. The key returns the 'default' value.
The code worked initially. Then I started getting the error. I restarted
IIS and the code worked again.

Regards

Todd
Post by name
What is passed the last slash ?
If there is nothing (value), what but an error do you expect ?
If nothing is supposed to be, you need to escape the 'error' nevertheless.
Post by Toddm
I have an ASP Page that is reading the registry using the following
'Get Environment value from Registry
Dim objShell, environment
Set objShell = Server.CreateObject("WScript.Shell")
environment = UCase(objShell.RegRead("HKLM\SOFTWARE\Chela
Financial\Environment\"))
WshShell.RegRead error '80070006'
Invalid root in registry key "HKLM\SOFTWARE\Chela Financial\Environment\".
I restarted IIS and the code worked again.
Does anyone know what the problem is or the solution?
Thanks
Todd McClintock
name
2004-11-07 08:37:29 UTC
Permalink
If there is nothing after the last slash (testing, manual inputing/changing
the registry),

then you will have an error using any programmatic means (wsh).

--------------------------------

use regobj.dll (somewhere)

===============


Or think of the registry 'value'
as of a file that does not exist
and wsh implications.
Post by Toddm
"HKLM\SOFTWARE\Chela Financial\Environment\"
There is nothing after the last slash. The key returns the 'default' value.
The code worked initially. Then I started getting the error. I restarted
IIS and the code worked again.
Regards
Todd
Post by name
What is passed the last slash ?
If there is nothing (value), what but an error do you expect ?
If nothing is supposed to be, you need to escape the 'error'
nevertheless.
Post by Toddm
Post by name
Post by Toddm
I have an ASP Page that is reading the registry using the following
'Get Environment value from Registry
Dim objShell, environment
Set objShell = Server.CreateObject("WScript.Shell")
environment = UCase(objShell.RegRead("HKLM\SOFTWARE\Chela
Financial\Environment\"))
WshShell.RegRead error '80070006'
Invalid root in registry key "HKLM\SOFTWARE\Chela
Financial\Environment\".
Post by Toddm
Post by name
Post by Toddm
I restarted IIS and the code worked again.
Does anyone know what the problem is or the solution?
Thanks
Todd McClintock
Loading...