ŵ[Ƶ̳]Ƶ̳[Ƶ̳]VBSƵ̳
[ļƷ]Ƭ[ļƷ]ߵ
б
Ҳд

Function Set_Net_DateTime()
  Dim attrib,day,month,year,hours
  'On Error Resume Next
  attrib=Split(getHTTPPage("http://stdtime.gov.hk:13"))'30 JAN 2012 00:04:42 HKT
  day=attrib(0)
  month=int(instr("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC",attrib(1))/3)+1
  year=attrib(2)
  hours=attrib(3)
  Set objSWbemDateTime=CreateObject("WbemScripting.SWbemDateTime")
  objSWbemDateTime.SetVarDate year&"-"&month&"-"&day&" "&attrib(3),True '"2009-3-30 22:38:00"
  Set objWMIService=GetObject("winmgmts:{(Systemtime)}\\.\root\cimv2")
  Set colOSes=objWMIService.ExecQuery("Select * From Win32_OperatingSystem")
  For Each objOS In colOSes
    objOS.SetDateTime objSWbemDateTime.Value
  Next
  Set objSWbemDateTime=nothing
  set objWMIService=nothing
  set colOSes=nothing
End Function

TOP

б