Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Function GetTime(vServer)
On Error Resume Next
Const OpenAsDefault = -2
Const FailIfNotExist = 0
Const ForReading = 1
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sTempFile = "C:\runresult.tmp"
oShell.Run "%comspec% /c net time \\" & vServer & ">" & sTempFile, 0, True
Set fFile = oFSO.OpenTextFile(sTempFile, ForReading, FailIfNotExist, OpenAsDefault)
sResults = fFile.ReadLine
fFile.Close
oFSO.DeleteFile (sTempFile)
aTime = Split(sResults, "is")
GetTime = aTime(1)
Set oShell = Nothing
Set oFSO = Nothing
End Function
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * From Win32_OperatingSystem")
For Each objItem in colItems
strTime = objItem.LocalDateTime
dtmTime = CDate(Mid (strTime, 9, 2) & ":" & Mid(strTime, 11, 2) & ":" & _
Mid(strTime, 13, 2))
dtmTime = CDate(dtmTime)
Wscript.Echo FormatDateTime(dtmTime, vbFormatLongTime)
Next