Quote:
> does anyone have experience reading registry keys with VBS which contain
> backslashes ("\") in den name of the value? How I have to enter them so the
> script engine interprests them as names of a value an not as another subkey?
> e.g. under "HKLM\SYSTEM\MountedDevices\\DosDevices\C:", how do I access the
> value of "\DosDevices\Y:"?
Hi
WSH registry functions is a kind of a Mickey Mouse implementation ;-), and
backslash in registry keys\values is a known issue in WSH.
Some workarounds (from VBScript):
A)
You can use Shell.run regedit.exe to export to a registry file and then parse
the file:
REGEDIT /E filename3 [regpath1]
REGEDIT /E:A filename3 [regpath1]
REGEDIT /A filename3 [regpath1]
/E filename3
Specifies the file to export the registry to.
/E:A and /A
Specifies ASCII output for W2k/WXP (default Unicode)
regpath1
Specifies the starting registry key to export from.
(Defaults to exporting the entire registry).
B)
Use WMI's StdRegProv (Standard Registry Provider). WMI comes default with
W2k/WXP, can be installed on W9x/WNT.
WMI Class StdRegProv:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmis...
C)
Install RegObj.dll that represents the registry via an object model with methods
to enumerate keys/values (and a lot more). RegObj.dll is a free, unsupported dll
from MS.
You can get RegObj.dll from:
Win32 Scripting [Clarence Washington]
http://cwashington.netreach.net/main/tools/default.asp?topic=n-z
You can use a wrapper (encapsulate_regobj.zip) from
http://cwashington.netreach.net to get it more "user friendly". You can also
find a couple of sample scripts which demonstrate how to enumerate there.
D)
Use a 3. party component for it:
Eg. http://www.jsware.net/jsware/scripts.html (JSSys.DLL)
--
torgeir