Hi All
My home computer take 6-7 mins to complete startup process. Before
just 3 mins.
Do you know how to check each startup process processing time by vbs ?
Time to startup my computer.
1. Last Boot Up Time : 2010/05/21 12:20:54 PM
2. System Up Time : 00:07:33
3. Current Local Time : 2010/05/21 12:28:27 PM
1. Last Boot Up Time : 2010/05/21 11:36:06 PM
2. System Up Time : 00:06:52
3. Current Local Time : 2010/05/21 11:42:58 PM
my uptime.vbs called by C:\Documents and Settings\Administrator\Start
Menu\Programs\Startup\Startup.bat
dim strComputer
dim objWMIDateTime, objWMI, colOS , objOS
strComputer = "." ' Local computer
set objWMIDateTime = CreateObject("WbemScripting.SWbemDateTime")
set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
set colOS = objWMI.InstancesOf("Win32_OperatingSystem")
for each objOS in colOS
objWMIDateTime.Value = objOS.LastBootUpTime
Wscript.Echo _
"1. Last Boot Up Time : " &
DateTimeStr(objWMIDateTime.GetVarDate) & chr(10) & _
"2. System Up Time : " & TimeSpan(objWMIDateTime.GetVarDate,Now)
& chr(10) & _
"3. Current Local Time : " & DateYMD(date) & _
" " & FormatDateTime(now(),3)
next
Function DateTimeStr(dt)
dim vstr
DateTimeStr = dateYMD(dt) & " " & FormatDateTime(dt,3)
end function
Function DateYMD (dt)
dim vstr
vstr = Year(dt) & "/" & right("00" & Month(dt),2) & "/" &
right("00" & Day(dt),2)
DateYMD = vstr
End function
Function TimeSpan(dt1, dt2)
Dim seconds
Dim minutes
dim hours
dim day
' Function to display the difference between
' 2 dates in hh:mm:ss format
If (isDate(dt1) And IsDate(dt2)) = false Then
TimeSpan = "00:00:00"
Exit Function
End If
seconds = Abs(DateDiff("S", dt1, dt2))
minutes = seconds \ 60
hours = minutes \ 60
minutes = minutes mod 60
seconds = seconds mod 60
if len(hours) = 1 then hours = "0" & hours
if hours > "25" then
day = hours \ 24
hours = hours mod 24
if len(hours) = 1 then hours = "0" & hours
TimeSpan = " " & day & " Days, " & hours & ":" & _
RIGHT("00" & minutes, 2) & ":" & _
RIGHT("00" & seconds, 2)
else
TimeSpan = hours & ":" & _
RIGHT("00" & minutes, 2) & ":" & _
RIGHT("00" & seconds, 2)
end if
End Function


