posting registry changes

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"
 
B

Brian McDermott

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

Brian
QA.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top