brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: shutdown /s /t turns off a Windows PC later, and /a calls it off

Windows
~/tips/tip-windows-shutdown-timer-abort

shutdown /s /t 3600 /c "Backup should be done by now"

Set a delayed shutdown for Windows and cancel it if you change your mind.

A long download or a backup that needs another hour doesn’t mean I have to sit next to the PC until it finishes. The built-in shutdown command takes a timer.

This shuts the machine down in one hour. The number after /t is in seconds:

shutdown /s /t 3600 /c "Backup should be done by now"

The text after /c is an optional comment, up to 512 characters. Swap /s for /r if you want a restart. When plans change, open a new Command Prompt window and run:

shutdown /a

That aborts the pending shutdown, as long as the countdown hasn’t run out yet. I like that it needs no scheduled task and no extra tool.

Watch out for one detail. According to Microsoft, any time-out above zero implies /f, which forces running applications to close without warning. Unsaved work in an open editor can be lost, so save everything before you start the timer. The default time-out is 30 seconds when you leave /t off, and the largest value allowed is 315360000, which is ten years.

Further reading: shutdown command reference

More Windows tips Win+Ctrl+C Win+Shift+Left arrow Win+Ctrl+Left arrow Alt+PrtScn Left Alt + Left Shift + Print Screen All Windows tips (33) All topics

Link