kimakabane
asked on
How to apply registry with logon script
I'd like to apply the following registry with vbs on particular OU.
Since this is under HKCU should be ran as logon script.
http://support.microsoft.com/kb/319206/en-us
HKEY_CURRENT_USER\Software \Microsoft \Exchange\ Exchange Provider
Value name: Closest GC
Data type: REG_DWORD
Radix: Hexadecimal
Value data: 0x00000001
Script has to determine if this registry is already exists, and if so should skip the process because I don't want to re-apply the registry.
Please help. I'm not good at scripting.
Since this is under HKCU should be ran as logon script.
http://support.microsoft.com/kb/319206/en-us
HKEY_CURRENT_USER\Software
Value name: Closest GC
Data type: REG_DWORD
Radix: Hexadecimal
Value data: 0x00000001
Script has to determine if this registry is already exists, and if so should skip the process because I don't want to re-apply the registry.
Please help. I'm not good at scripting.
ASKER
Hi,
I copy pasted the script and create .vbs but nothing has created under the key.
Also I had to correct
oReg.GetDWORDValue
to
objReg.GetDWORDValue
I think this is just a typo.
No error message, but nothing created. I'm sure that I have local admin rights.
I copy pasted the script and create .vbs but nothing has created under the key.
Also I had to correct
oReg.GetDWORDValue
to
objReg.GetDWORDValue
I think this is just a typo.
No error message, but nothing created. I'm sure that I have local admin rights.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
worked... Thanks!
:^)
Happy to help!
Happy to help!
Const HKEY_CURRENT_USER = &H80000001
Dim objReg:Set objReg=GetObject("winmgmts
strKeyPath = "Software\Microsoft\Exchan
strValueName = "Closest GC"
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPa
If strValue="" Then
objReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPa
End If
Set objReg=Nothing