我有一个问题,从 ASP 我需要写入包含空格的路径的 Windows 注册表项。WScript.Shell RegRead 对我的密钥很满意,但 RegWrite 不喜欢它。我已经使用其他(虚拟)路径进行了测试,看起来确实是导致问题的空间。
<%
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"
%>
获取:注册表项“HKLM\SOFTWARE\Data Access Worldwide\Visual DataFlex\10.0\WebApp Server\Web Applications\DAW.Examples.Order10\Disable”中的根无效。
有谁知道如何解决这个问题?如何逃离空间?
我尝试使用“HKEY_LOCAL_MACHINE”的“HKLM”缩写、额外的引号、波浪线和其他替换空格,但现在我没有想法了。:-(
TIA
麦克风