Is there a way to make one of these just for boot up time?
Try this:
Restart-and-Boot-Time.vbs
Code:
On Error Resume Next
MsgA = "Please close all running applications and click on OK."
KeyA = "HKEY_CURRENT_USER\Software\RestartTime\"
KeyB = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\RestartTime"
AppName = "Restart-and-Boot-Time"
strComputer = "."
Set objWMIService = GetObject ("winmgmts:\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
Set WshShell = CreateObject("WScript.Shell")
PathFile = """" & WScript.ScriptFullName & """"
Result = WshShell.RegRead(KeyA & "Times")
If Result = "" then
MsgResult = Msgbox (MsgA, vbOKCancel, AppName)
If MsgResult = vbcancel then WScript.Quit
WshShell.RegWrite KeyA & "Times", left(Time,8), "REG_SZ"
WshShell.RegWrite KeyB, PathFile, "REG_SZ"
WshShell.Run "cmd /c Shutdown -r -t 00", false, 0
else
For Each objOS in colOperatingSystems
dtmBootup = objOS.LastBootUpTime
dtmLastBootupTime = CDate(Mid(dtmBootup, 5, 2) & "/" & Mid(dtmBootup, 7, 2) & "/" & Left(dtmBootup, 4) & " " & Mid (dtmBootup, 9, 2) & ":" & Mid(dtmBootup, 11, 2) & ":" & Mid(dtmBootup, 13, 2))
BootTime = DateDiff("s",dtmLastBootupTime,now)
Next
WshShell.RegDelete KeyA & "Times"
WshShell.RegDelete KeyA
WshShell.RegDelete KeyB
TimeDiff = DateDiff("s",Result,left(Time,8))
MsgBox "Your computer restarts in " & TimeDiff & " seconds and" & vbLF & "Boots in approximately " & BootTime & " seconds", VbInformation, AppName
End if