My News Leecher - Sharing All the Latest News
Please Login or Register for new user.

Join the forum, it's quick and easy

My News Leecher - Sharing All the Latest News
Please Login or Register for new user.
My News Leecher - Sharing All the Latest News
Would you like to react to this message? Create an account in a few clicks or log in to continue.

How to Test Your Computer's Reboot Time

Go down

How to Test Your Computer's Reboot Time Empty How to Test Your Computer's Reboot Time

Post by coolng Tue May 03, 2011 7:17 pm

This works for both XP, Vista and Windows 7

Open Notepad and copy everything in the code box below and paste it in Notepad.

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 = "[MyNewsLeecher] 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,Cool, "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,Cool)
MsgBox "Your computer reboots in " & TimeDiff & " seconds", VbInformation, AppName
end if
wscript.Quit

Save the file as Reboot Time.vbs on anywhere, your desktop for example. You can choose to save the file as any name you want, just make sure the file ends with a .vbs extension.


How to use :

Double click on the script file you saved.
Close all the running applications and click the OK button in the dialog box.
The computer will reboot and when Windows and a dialog box will open displaying the time your computer took to reboot.

How it works :

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. Later, another value containing the time is written in the registry when the reboot starts. 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 to the registry are removed (the run key and the key where the time is stored).

coolng
coolng
Owner
Owner

Posts : 162
Join date : 2011-04-30
Location : World Wide Web

https://mynewsleecher.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum