Sets the difference (in minutes) between the time zone in use on the specified computer and Greenwich Mean Time. The time zone offset value, which is assigned to the CurrentTimeZone property of Win32_ComputerSystem, can be either positive or negative.

Visual Basic
Edit|Remove
On Error Resume Next

strComputer = "."
'Change value to reflect desired GMT offset in minutes.
intGMTOffset = -480

Set objWMIService = GetObject("winmgmts:" _
 & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colCompSys = objWMIService.ExecQuery _
 ("Select * from Win32_ComputerSystem")

For Each objCompSys in colCompSys
  objCompSys.CurrentTimeZone = intGMTOffset
  objCompSys.Put_
  If Err = 0 Then
    Wscript.Echo "Time zone set to specified value."
  Else
    Wscript.Echo "Unable to set time zone."
  End If
  Err.Clear
Next