Sudheer Muthusamy
Sudheer Muthusamy

Reputation: 307

How to Refresh the Registry Settings through VBScript?

I am modifying the Proxy settings by modifying the registry value. After that i am rebooting my Windows 7 machine.But still it is taking approximately 10 minutes to reflect the changes even after system reboot.

Is there any way to refresh the settings instantaneously once the registry is updated ?

I have tried already to flush the DNS cache.

objShell.Run("ipconfig /flushdns"),1,True

Upvotes: 1

Views: 680

Answers (1)

Hackoo
Hackoo

Reputation: 18857

Try to refresh Explorer.exe by killing and running it like this way :

Option Explicit
Dim ProcessName : ProcessName = "Explorer.exe"
Refresh(ProcessName)
'*********************************************************************
Sub Refresh(ProcessName)
Kill(ProcessName)
RunIt(ProcessName)
End Sub
'*********************************************************************
Sub Kill(ProcessName)
Dim Ws : Set Ws = CreateObject("Wscript.Shell")
Dim Command : Command = "Taskkill /F /IM "& ProcessName &""
Dim Result : Result = Ws.Run(Command,0,True)
End Sub
'*********************************************************************
Sub RunIt(ProcessName)
Dim Ws : Set Ws = CreateObject("Wscript.Shell")
Dim Result : Result = Ws.Run(ProcessName,1,False)
End Sub
'*********************************************************************

Upvotes: 1

Related Questions