posting registry changes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The following script changes a registry setting. The changes do not take
effect until a logoff/logon occurs. How do I post the changes to windows so
it becomes effective immediately?

Regards

Col

HKEY_CURRENT_USER = &H80000001

strComputer = "."
Set objReg = GetObject("winmgmts:\\" & strComputer &
"\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
objReg.CreateKey HKEY_CURRENT_USER, strKeyPath
ValueName = "Start_ShowControlPanel"
dwValue = 2
objReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, ValueName, dwValue

msgbox "Done"
 
As an alternative to logging on/off you could kill and restart explorer.

Brian
QA.com
 
Back
Top