"윈도우 uptime"의 두 판 사이의 차이

잔글 (윈도우 UPTIME 확인 문서를 윈도우 uptime(으)로 옮김)
(차이 없음)

2013년 6월 16일 (일) 01:04 판

윈도우 UPTIME 확인

1 방법 1: powershell on cmd

방법2의 powershell 명령어를 CMD로 포장한 것.

명령어
powershell "$u=Get-WmiObject -Class Win32_OperatingSystem; $u.ConvertToDateTime($u.LocalDateTime)-$u.ConvertToDateTime($u.LastBootUpTime)" | findstr TotalDays
실행예시
C:\Users\jmnote>powershell "$u=Get-WmiObject -Class Win32_OperatingSystem; $u.ConvertToDateTime($u.LocalDateTime)-$u.ConvertToDateTime($u.LastBootUpTime)" | findstr TotalDays
TotalDays         : 23.934793401956
→ 부팅된지 약 23.9일 되었다.

2 방법 2: powershell

명령어
$wmi = Get-WmiObject -Class Win32_OperatingSystem
$wmi.ConvertToDateTime($wmi.LocalDateTime) - $wmi.ConvertToDateTime($wmi.LastBootUpTime)
실행예시
PS C:\Users\jmnote> $wmi = Get-WmiObject -Class Win32_OperatingSystem
PS C:\Users\jmnote> $wmi.ConvertToDateTime($wmi.LocalDateTime) - $wmi.ConvertToDateTime($wmi.LastBootUpTime)

Days              : 23
Hours             : 22
Minutes           : 18
Seconds           : 24
Milliseconds      : 8
Ticks             : 20675040089290
TotalDays         : 23.9294445477894
TotalHours        : 574.306669146944
TotalMinutes      : 34458.4001488167
TotalSeconds      : 2067504.008929
TotalMilliseconds : 2067504008.929
명령어 변형예시
$wmi = Get-WmiObject -Class Win32_OperatingSystem
$uptime = $wmi.ConvertToDateTime($wmi.LocalDateTime) - $wmi.ConvertToDateTime($wmi.LastBootUpTime)
echo $uptime
→ 변수에 담아둘 수도 있다.

3 방법 3: uptime.exe

  • uptime.exe 다운로드
http://download.microsoft.com/download/winntsrv40/install/uptime_1.01/nt4/en-us/uptime.exe
어디서든 실행할 수 있도록 C:\Windows\System32에 다운로드
C:\Users\jmnote>uptime
\\JMNOTE-PC has been up for: 3 day(s), 7 hour(s), 10 minute(s), 52 second(s)

→ 3일 7시간 10분 52초

4 방법 4: systeminfo

윈도우 2003, XP에서는 systeminfo에 Uptime이 나온다.[1]

C:\Documents and Settings\jmnote>systeminfo | findstr Time
System Up Time:          42일, 0시간, 54분, 26초

5 방법 5: wmic

wmic로 부팅시간을 보고 수작업으로 계산하자. (...)[2]

명령어
wmic os get lastbootuptime
실행예시
C:\Users\jmnote>wmic os get lastbootuptime
LastBootUpTime
20120715071501.125019+540
→ 2012-07-15 07:15:01

6 같이 보기

7 주석

  1. 반면 윈도우 2008, 7에서는 부팅시각이 나온다.
  2. powershell이 없는 윈도우 2003, XP에서는 방법1, 방법2 사용불가

8 참고 자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}