Main | How to Fix the Error "The User Profile Service failed the logon. User profile cannot be loaded." »
Friday
27Nov2009

How to See What Your Boot Up Time is in Vista

To optimize the boot/shutdown of Windows, it is necessary to know precisely the reboot time of the computer to be able to refine its adjustments. But rather than having the hand on a stop watch at the time of the reboot, better use this easy way, You will appreciate how simple it is to use and the precision of the result.

The relative time value will then give you a point of comparison to optimize the boot/shutdown of your computer.

In order to calculate the time of rebooting Windows, we will use a VB Script (Visual BASIC Scripting Edition). Let us learn first how it works.

The script writes a value in the registry (HKCU \ Software \ Microsoft \ Current Version \ run) so that it can be started again when booting. Then, another value containing the time is writen in the registry when the reboot is launched. While rebooting, the script records the hour in a variable then checks if the first value containing the time exists. If so, it is then enough to compare two times in order to obtain the time of rebooting. Then, the two keys added in the registry are removed (the run key and the key where the time is stored).

EXAMPLE: ReBoot-Time dialog box
NOTE: This is what you will see after running the VB Script file from below and when you computer finishes restarting.

  1. Open your favorite text editor (notepad will do the job perfectly) and copy/paste the following script:

    Option Explicit On Error Resume Next Dim Wsh, Time1, Time2, Result, PathFile, MsgResult, MsgA, AppName, KeyA, KeyB, TimeDiff 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 = "ReBoot-Time" Set Wsh = CreateObject("WScript.Shell") PathFile = """" & WScript.ScriptFullName & """" Result = wsh.RegRead(KeyA & "Times") if Result = "" then MsgResult = Msgbox (MsgA, vbOKCancel, AppName) If MsgResult = vbcancel then WScript.Quit Wsh.RegWrite KeyA & "Times", left(Time,8), "REG_SZ" Wsh.RegWrite KeyB, PathFile, "REG_SZ" Wsh.Run "cmd /c Shutdown -r -t 00", false, 0 else Wsh.RegDelete KeyA & "Times" Wsh.RegDelete KeyA Wsh.RegDelete KeyB TimeDiff = DateDiff("s",Result,left(Time,8)) MsgBox "Your computer reboots in " & TimeDiff & " seconds", VbInformation, AppName end if wscript.Quit


  2. Save the file wherever you want on the same HDD (desktop for example) as ReBoot-Time.vbs (you can choose whatever name as far as the extension is ".VBS".

    Use of the Script:

    • Double click on the script icon if it is on your desktop or on the file if you saved it in a particular folder.
    • Close all the running applications and click the OK button in the dialog box.
    • The computer will reboot and when Windows will be ready to be used, a new dialog box will open displaying the time your computer took to reboot.

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>