I made a script to update the Windows Time Zone. In my example i want to use the Romance Standard time which is easily done by specifying this as an argument to the function SetTimeZone
SetTimeZone("Romance Standard Time")
Sub SetTimeZone(timezone)
On Error Resume Next
Set objSh = CreateObject("WScript.Shell")
Dim process, processid, strUpdateCommand
Set process = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2:Win32_process")
'Add time change privilege to the process object
process.Security_.Privileges.AddAsString "SeSystemTimePrivilege",True
strUpdateCommand = "control.exe timedate.cpl,,/Z" & timezone
'Launch control.exe to refresh time zone information
process.create strUpdateCommand,Null,Null,processid
End Sub
Recent Comments