I have a problem in that from ASP I need to write to a Windows Registry key the path to which contains spaces. The WScript.Shell RegRead is happy enough with my key, but RegWrite doesn't like it. I have tested using other (dummy) paths and it really looks like it is the spaces that are causing the problem.
<%
Dim WSH, disable
Set WSH = CreateObject("WScript.Shell")
disable = Request("disable") ' disable will be 1 or 0
key = "HKEY_LOCAL_MACHINE\SOFTWARE\Data Access Worldwide\" & _
"Visual DataFlex\10.0\WebApp Server\Web Applications\" & _
"DAW.Examples.Order10\Disable"
WSH.RegWrite key, CInt( disable ), "REG_DWORD"
%>
Gets: Invalid root in registry key "HKLM\SOFTWARE\Data Access Worldwide\Visual DataFlex\10.0\WebApp Server\Web Applications\DAW.Examples.Order10\Disable".
Anybody know what to do to fix the problem? How to escape the spaces maybe?
I've tried using the "HKLM" abbreviation for "HKEY_LOCAL_MACHINE", extra quotes, tildes and other substitutions for the spaces, but now I'm out of ideas. :-(
TIA
Mike