How to Set a Shutdown Timer on Your Computer
You leave your desk, the download is running, and you want the machine to power off after it finishes. Or maybe you just want to fall asleep with a video playing and need the PC to shut down on its own. Either way, there's a built-in Windows command that handles this without installing anything. It's called shutdown with the -t flag, and it's been around since Windows XP. The basic syntax is straightforward: open Run (Windows key + R), type cmd, and run shutdown /s /t 7200. That 7200 is seconds, so two hours. The computer will count down and cut power when it hits zero. If you change your mind before then, run shutdown /a to abort. Cancel it at any point up until the final seconds. I've forgotten that abort command more times than I care to admit while debugging scripts at 2 AM. Every time, I'm sweating for thirty seconds before remembering to hit Run and type it in.
Turn Of Computer In 2 Hurs Command Master The Shutdown Timer Like A Pro
Here's where most people stop reading and that's fine if a basic timer does what you need. But the command line gives you more options than just a plain countdown. Add /f to force-close running applications without prompting. That saves you from coming back to find some program hung open and blocking the shutdown. The downside is you lose unsaved work in those apps. Use it when you know nothing critical is running, or when you'd rather deal with a forced close than wait around to cancel everything manually. You can also combine this with other arguments. shutdown /s /t 7200 /c "Going offline" drops a custom message on the screen before the shutdown begins. Useful if someone else in the house might be using the machine and you want to warn them. The /c parameter accepts any string up to 512 characters. Longer than that and Windows truncates it without warning, which is an edge case I ran into once when I tried to paste a long status update. The timer still fired, but the message cut off mid-sentence. Took me a while to figure out why it looked wrong. For Mac users, the equivalent uses a terminal command instead of a Run dialog. Open Terminal and type sudo shutdown -h +120. That's minutes, not seconds, so two hours is 120. The -h flag tells it to halt after shutting down rather than reboot. Without -h, the system comes back on immediately after the process completes. I learned that the hard way on a server I was managing remotely. Scheduled a shutdown timer, walked away, came back to find the machine cycling on and off every two hours because I'd missed the halt flag. Drove me nuts until I checked the logs.
Linux uses almost the same command as Mac but with slightly different syntax depending on your distro. On most distributions, sudo shutdown +120 works fine. The system shows a broadcast message to all logged-in users ten minutes before shutdown, which is actually helpful in shared environments. On Ubuntu Server specifically, you can set a scheduled shutdown in crontab if you need this to happen regularly rather than as a one-off. Something like 0 2 * * * /sbin/shutdown -h now for a daily shutdown at 2 AM. But that's a separate topic from a simple one-time timer. There are legitimate reasons to skip the command line entirely and grab a third-party tool instead. Programs like Shutdown Timer and Easy Shutdown Timer offer GUI interfaces with preset durations, wake-on-LAN support, and reminders. They're fine for casual use. The problem is they often bundle adware or tracking code, and they add unnecessary background processes to your system. The native command does the same job with zero overhead. I tried a couple of these tools early on because the GUI felt easier, and within a week my startup time had gotten slower. Uninstalled both and went back to the command line. One thing nobody really warns you about is that network-based shutdowns don't always work reliably over Wi-Fi. If your machine drops to a wireless network that goes to sleep or loses connectivity during the countdown, the shutdown might not trigger cleanly. I had a desktop that would shut down perfectly on Ethernet but occasionally hang at the final countdown screen when connected wirelessly. Switching to a wired connection fixed it completely. If you're running this on a laptop that moves between networks, stick to the built-in local timer rather than something that relies on remote execution.
Get the Full Details

Another gotcha is that some antivirus software will prompt for confirmation before allowing a shutdown command to execute. You might type the command, see nothing happen, and assume it failed. Check your security software's notification area and approve the action if it asks. This is especially common with enterprise-grade endpoints that enforce IT policies. Personal machines rarely have this issue, but if you're working on a company laptop, it's probably already configured to require approval for system-level commands. The countdown itself can be interrupted by system updates that demand an immediate restart. Windows Update occasionally overrides shutdown timers during feature updates. If you're running a long download or render job and schedule a shutdown for later, a pending update might cancel your timer and restart the machine on its own schedule. There's no reliable workaround for this besides pausing updates before you set your timer. Control Panel > Windows Update > Pause updates for one week gets you enough buffer in most cases. PowerShell gives you slightly more control if you want to script this. Start-Process -FilePath "shutdown" -ArgumentList "/s /t 7200 /f" runs the same command but through PowerShell's object pipeline. You can chain it with other tasks, log timestamps, or send notifications when the shutdown completes. It's overkill for a one-time timer, but if you automate your workflow regularly, wrapping it in a script saves you from retyping the same arguments every morning.
For the record, this approach only works on Windows, macOS, and Linux desktops. It won't do anything on a Chromebook, a Raspberry Pi running certain headless setups, or any device that doesn't expose the standard shutdown utilities. If you're trying to time a shutdown on something unusual, you'll need to check the manufacturer's documentation or look into their specific scripting tools. The command-line method is fast, requires no downloads, and runs quietly in the background without additional software sitting in your system tray. That's why I keep coming back to it even though GUI alternatives exist. The learning curve is roughly thirty seconds, and once you memorize the two commands you actually need, you never have to think about it again.