Skip to main content
SysAdmin Shell Scripting Essentials

Windows CMD Uptime: CLI Commands, Syntax & Examples

cmd uptime is the practice of retrieving Windows OS uptime via Command Prompt using built-in tools like systeminfo, net statistics workstation, WMIC, or the legacy uptime.exe utility.

systeminfo | find "System Boot Time"

Why Windows system uptime matters

In production Windows environments, knowing the exact system uptime is critical before applying patches, rebooting for maintenance, or investigating performance degradation. A server running for 300+ days may indicate a pending stability issue or missed update cycles. For example, in a fleet of 200+ Windows Server 2019/2022 instances across four data centers, verifying each machine’s uptime before any scheduled reboot is standard procedure.

Methods to check uptime in Windows CMD

Below are the verified commands for retrieving uptime on Windows, each with its own characteristics and caveats.

  1. Local check with systeminfo
    systeminfo | find "System Boot Time"

    Works on English systems. On non-English OS, use findstr /i "boot" instead. Output gives local time of last boot; uptime must be calculated manually.

    Result: System Boot Time: 10/14/2024, 9:30:15 AM

  2. Using net statistics for quick uptime
    net statistics workstation | find "Statistics since"

    Returns the date/time when the workstation service started, which closely matches system boot. No calculation needed.

  3. WMIC for direct uptime in minutes
    wmic os get lastbootuptime

    Outputs YYYYMMDDHHMMSS.ffffff+ZZZ format. Parse via for /f in batch scripts to compute hours.

  4. PowerShell one-liner via cmd
    powershell "Get-CimInstance -ClassName Win32_OperatingSystem | select LastBootUpTime"

    Returns a proper datetime object. On older systems (pre-PowerShell 3.0), fall back to WMIC.

  5. uptime.exe for legacy systems
    uptime.exe

    Downloaded from Microsoft’s Windows Server Resource Kit and copied to C:WindowsSystem32. Output: System uptime: 12 days 4 hours 31 minutes 15 seconds. Works on Windows XP/2003/7.

See also  git reset --soft: Syntax, Use Cases, and Troubleshooting

Command Cheat Sheet

Action CMD Command Key Flag Description
Get boot time (English) systeminfo | find “System Boot Time” N/A Shows last boot time in local format.
Get boot time (any language) systeminfo | findstr /i “boot” /i (case-insensitive) Matches “Boot” or “boot” in any language.
Get uptime from workstation service net statistics workstation | find “Statistics since” N/A Shows when the workstation service started.
Get last boot UTC via WMIC wmic os get lastbootuptime N/A Returns YYYYMMDDHHMMSS format.
Get last boot via PowerShell powershell “Get-CimInstance Win32_OperatingSystem | select LastBootUpTime” N/A Requires PowerShell 3.0+; returns datetime.
Direct uptime display uptime.exe N/A Resource Kit tool; shows days/hours/minutes.

Common pitfalls and lessons learned

  • Locale breakage: find "System Boot Time" fails on German Windows (outputs “Systemstart”). Use a generic filter like findstr /i "boot" or switch to WMIC.
  • Wrong trust in uptime.exe: The utility reports uptime since the last kernel boot, but if the system entered hibernation, the counter continues — leading to inflated values. For post-hibernation accuracy, use systeminfo.
  • Security permissions: On domain controllers, net statistics workstation might not be available if the Workstation service is disabled. Prefer WMIC or PowerShell.
  • Error 0xc0000098: This Windows boot error can cause no boot time to be shown. The actual cause is a corrupted BCD, not a command failure. Verify with multiple methods.
  • Automation overhead: Running systeminfo on many remote machines over WinRM caused high network latency. Use wmic /node:server1 os get lastbootuptime to reduce traffic.

Frequently Asked Questions

How do IT admins manage uptime effectively?

IT admins monitor performance, schedule maintenance, and use monitoring tools for efficient uptime management.

Why is my system uptime incorrect?

Incorrect system clock settings, power interruptions, or Windows hibernation settings can cause inaccurate uptime readings. Verify with multiple commands.

Does uptime.exe work on Windows 10/11?

uptime.exe from the Resource Kit works on Windows 10/11, but Microsoft recommends using PowerShell or WMIC for modern systems.

What about the Linux “uptime” command on Windows?

The Linux uptime command is not available in Windows CMD. Use systeminfo, WMIC, or PowerShell instead.