PC Uptime Since last boot - RonsWebRemoteTools

Published Saturday, January 10, 2009 3:38 PM

Here is an add-on to Ron's Web Remote Tools page to find the PC’s uptime since its last boot up on a given machine, it will prompt you for the machine name, then open up notepad and display similar to “\\PCNAME has been up for: 0 day(s), 2 hour(s), 9 minute(s), 1 second(s)”

Edit machrest.asp (take a back up, always better to be on the safe side) add the following around line 80ish or at the end of your other buttons, <input style='WIDTH: 180px' type='button' value='PC uptime since last boot' name='Btn745' ID='Button745'>

Add the following sub near the bottom, before </script>

' upTime since last boot!
Sub Btn745_OnClick
compname = trim(document.frmMain.txtValue.value)
Set WShell = CreateObject("WScript.Shell")
set fso = CreateObject("Scripting.FileSystemObject")
strSMSServerName = "ServerName"
strDMSourceFldr = "\\" & strSMSServerName & "\Remote$"
strcmdending = "\\ServerName\Remote$\uptime.bat" & chr(34) & " -c: -h: -m:" & chr(34) & compname & chr(34) & " -a:1"
        wShell.run chr(34) & strDMLocalFldr & strcmdEnding,1,vbFalse
End Sub
' gtk ends upTime since last boot!

Copy uptime.bat (edit and add your server details) & uptime.exe to your Remote$ share.

Credit goes to MeenEnta (aka George K) for sharing the addons, see forum post here

Attachment: Uptime.zip
Filed under:

Comments

No Comments