PDA

View Full Version : help spaces in registry value


legend_018
09-15-2006, 11:32 AM
This searches for the value of DS Server. If I set DS Server to DSServer with no spaces in the registry this script works - of course I have to change it so it has no spaces.
However, I it to work with spaces. It keeps saying error on line 2. I tried ' and " quotes around DS Server. Help?
>>
Option Explicit
Dim WSHShell, RegKey, DS Server
Set WSHShell = CreateObject("WScript.Shell")
RegKey = "HKLM\SOFTWARE\Microsoft\Exchange\Exchange Provider\"
DS Server = WSHShell.RegRead(RegKey & "DS Server")
WScript.echo "Value is: " & DS Server


MODIFICATION:
nevermind
Option Explicit
Dim WSHShell, RegKey, DSServer
Set WSHShell = CreateObject("WScript.Shell")
RegKey = "HKLM\SOFTWARE\Microsoft\Exchange\Exchange Provider\"
DSServer = WSHShell.RegRead(RegKey & "DS Server")
WScript.echo "Value is: " & DSServer