Go Back   TechArena Community > Software > Tips & Tweaks
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Calculate the time to reboot in Windows

Tips & Tweaks


Reply
 
Thread Tools Search this Thread
  #1  
Old 26-11-2008
Member
 
Join Date: Mar 2008
Posts: 201
Calculate the time to reboot in Windows
  

To optimize the Windows startup, it is necessary to know precisely the time to start your PC in order to refine its settings. But rather than having your hand on the clock at boot, try this trick! You will appreciate the simplicity of implementation and accuracy of the result! This relative value will give you a benchmark for optimizing the time to start your PC.

To calculate the time you restart Windows, we will create a script VBScript (Visual Basic Scripting Edition). But before beginning the creation of the script itself, let us first on its operation.

How the script:

The script writing a value in the registry (HKCU \ Software \ Microsoft \ Current Version \ run) to be able to restart at startup. Then, another value containing the time is recorded in the registry and then reboot is launched. Restarting, the script saves time in a variable and then checks if the value containing the first time there. If yes, then you just have to compare the two time to get the startup time. Finally, the two keys are added in the register are deleted (the key run and where the key is stored hour).

Creation of the script:

Open your favorite editor (Notepad will perfectly case: Start menu, select Run ... and type notepad) and copy the following:

Option Explicit
On Error Resume Next

Sunday Wsh, time1, Time2, Result, PathFile, msgResults, MsgA, AppName, Keya, Keyb, TimeDiff

MsgA = "timing for restarting, please close all running applications and click OK."
Keya = "HKEY_CURRENT_USER \ Software \ RestartTime \"
Keyb = "HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Run \ RestartTime"
AppName = "Restart-Time"

Set Wsh = CreateObject ( "WScript.Shell")

PathFile = "" "" & WScript.ScriptFullName & "" ""
Result = wsh.RegRead (Keya & "Times")


if Result = "" then if Result = "" then
MsgResults = Msgbox (MsgA, vbOKCancel, AppName)
If msgResults = vbCancel then WScript.Quit
Wsh.RegWrite & "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 & "Times"
Wsh.RegDelete Keya
Wsh.RegDelete Keyb
TimeDiff = DateDiff ( "s", Result, left (Time, 8))
MsgBox "PC restarted in" TimeDiff & & "seconds", vbInformation, AppName
end if

Wscript.Quit


Save the file on the desktop with the name-Time.vbs Restart.

Note that the script can have the name of your choice (with the. Vbs) and can be performed anywhere on the disc (unlike the first version of the script).

Using the script:
  • Just click on the script Restart-Time.vbs on your desktop.

  • One dialog box will appears.

  • Click OK. The computer then restarts when the next dialog box appears.

  • The time to restart is then shown.

  • Note to users of Windows Vista so that the timing is done correctly, you must uncheck the box requesting confirmation to use the script when you run for the first time.


Note: This trick is usable directly in Windows 98/98 Second Edition, Windows ME, 2000 and XP and all versions of Windows using Internet Explorer 5 or higher. If this is not your case you should download from the Microsoft site version 5 of MSE (Microsoft Scripting Engines) or higher. For more information about VBS, an address: http://support.microsoft.com/support.../q188/1/35.asp.

Reply With Quote
Reply

  TechArena Community > Software > Tips & Tweaks
Tags: , , , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Calculate the time to reboot in Windows"
Thread Thread Starter Forum Replies Last Post
How to calculate the average time in excel Rao's Windows Software 1 06-01-2012 10:48 PM
Theme keeps changing every time I reboot under Windows 7 Jai-Ho Operating Systems 4 24-10-2010 06:13 AM
How to Calculate Process Time in Java? Bhardwaj Software Development 3 08-12-2009 12:25 PM
How to calculate time infopath Dharmavira Windows Software 3 14-07-2009 10:57 AM
Windows XP Automatic Updates 'Disabled'- every time after reboot!! Can't_Stand_Hackers Windows Update 7 29-07-2008 07:39 AM


All times are GMT +5.5. The time now is 03:11 AM.