Thursday, July 14, 2011

Utolso bootolas idejen Windowson

Innen.

From a command prompt window run the following (the 'S' in 'Statistics' must be capitalized):
net statistics workstation | find "Statistics"
You can shortcut it as well using:
net stats work | find "Stat"
Or ever shorter use either of the following:
net stats work
netstats work |more
This next method uses the command 'systeminfo.' Again from a command prompt run (make sure to capitalize 'S', 'B' and 'T':
systeminfo | find "System Boot Time"
You can use the following on XP, Windows 2003 and earlier (however this will give only the length of uptime and not the system boot time):
systeminfo | find "Up Time"
The third method uses WMI, more specifically wmic (Windows Management Instrumentation Command-line), but the output is a little cryptic:
wmic OS Get LastBootUpTime
You can always use the system event log (this only works on 2003/XP or older). Of course, you could go to Control Panel and browse through the system event log, but let's do it through the command line with:
cscript c:\windows\system32\eventquery.vbs /fi "ID eq 6005" /l system
Finally, you can use this handy PowerShell script:

Get-WmiObject Win32_NTLogEvent -filter "LogFile='System' and EventCode=6005" | Format-Table ComputerName, EventCode, Message, TimeWritten