Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WSH issue using RegRead

Status
Not open for further replies.
Apr 18, 2002
1
US
I would like to use the RegRead command to return specific registry data. The registry key is HKLM\hardware\devicemap\video\ and the value is \Device\Video0. The problem seems to be that the value begins with a "\". I can get other values to return data within the same key but when I try to use the \Device\Video0 value, I get an invalid root error. Is there any way around this?

Thanks for your help!

This code works:

Code:
Dim WSHShell, RegKey, VideoPath 
Set WSHShell = WScript.CreateObject("WScript.Shell") 
RegKey="HKLM\hardware\devicemap\video\VgaCompatible"
VideoPath=WSHShell.RegRead(RegKey)
WScript.echo "Path to video: " & VideoPath

This code, which is what I need, does not work:

Code:
Dim WSHShell, RegKey, VideoPath 
Set WSHShell = WScript.CreateObject("WScript.Shell") 
RegKey="HKLM\hardware\devicemap\video\\Device\Video0"
VideoPath=WSHShell.RegRead(RegKey)
WScript.echo "Path to video: " & VideoPath

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top