WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

System Information

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Time of Last Shutdown


Question:

Question, is there a way to tell the last time shutdown was done are the time a system has been up.

Answer:

Maybe see: http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/WMI+WMI~causing~LLSMGR~to~start.txt

Also the GetTickCount funtion might be "interesting" if none of the machines are *ever* on more than 3 weeks at a time.

Or give this Process Extender code a try:

AddExtender("wwprc44I.dll")
AddExtender("wwipg44i.dll")

host = AskLine("HOST", "Please enter host name", "")
x=ipPing(host,13)
If x == @TRUE

CurServer = StrCat("\\",host)
tRemoteConn(CurServer)
CurrentUptimeSecs = tGetData(StrCat(CurServer,"\System\System Up Time"),0)

days = CurrentUptimeSecs / 86400
hours = (CurrentUptimeSecs / 3600) - (days * 24)
minutes = (CurrentUptimeSecs / 60) - (days * 1440) - (hours * 60)
seconds = CurrentUptimeSecs mod 60

msg = StrCat(days," Days", @crlf, hours," Hours", @crlf, minutes," Minutes",@crlf,seconds," Seconds")

message("%host% UP Time","%msg%")
Else

Message ("ERROR","Server: %host% not responding")
Endif

Article ID:   W16492
File Created: 2014:07:18:09:51:38
Last Updated: 2014:07:18:09:51:38