系統時間總是自動改為
===========================(復制以下代碼)======================================
set fso=CreateObject("Scripting
set ws=CreateObject("wscript
set f=fso
ws
strComputer="
Set objSWbemDateTime=CreateObject("WbemScripting
Set objWMIService=GetObject("winmgmts:{(Systemtime)}" & strComputer & "rootcimv
oldtime = Now()
strNewDateTime=GetServerTime()
objSWbemDateTime
dtmNewDateTime=objSWbemDateTime
Set colOSes=objWMIService
For Each objOS In colOSes
objOS
Next
newtime = Now()
Wscript
Function GetServerTime()
Url = "
innerHTML = BytesToStr(GetHttpPage(Url)
Dim regEx
Set regEx = New RegExp
regEx
regEx
p
regEx
Set mhs = regEx
GetServerTime = Now()
If mhs
net_year = CStr(mhs
net_month = CStr(mhs
net_date = CStr(mhs
net_hour = CStr(mhs
net_minute = CStr(mhs
net_second = CStr(mhs
GetServerTime = net_year & "
End If
End Function
Function GetHttpPage(URL)
On Error Resume Next
Set objXmlHttp = CreateObject("Microsoft
objXmlHttp
objXmlHttp
If objXmlHttp
Exit Function
End If
GetHttpPage = objXmlHttp
If Err
Set objXmlHttp=Nothing
Exit Function
End If
Set objXmlHttp = Nothing
End Function
Function BytesToStr(Str
Dim objStream
Set objStream = CreateObject(Replace("ADODB
objStream
objStream
objStream
objStream
objStream
objStream
objStream
BytesToStr = objStream
objStream
Set objStream = Nothing
End Function
======================================(虛線不要復制)=======================================
From:http://tw.wingwit.com/Article/Common/201311/7389.html