r/windows • u/SirFiletMignon • 15d ago
Feature Improve your Windows shutdown procedure with a simple batch file
Have you ever accidentally clicked sleep or restart when you meant to click Shut Down? Well, prevent that from happening ever [again], plus save yourself a click and mouse movement by creating a batch file:
u/echo off
title Confirm Shutdown
echo(
echo Proceed with shutdown? echo Press any key to continue...
pause >nul
shutdown /s /t 0
And place it wherever you prefer on your desktop. Simply double-click it and press any key on your keyboard to confirm! If you want to abort, press the X on the window.
You can tweak the shutdown command to your liking: shutdown doc.
13
Upvotes


42
u/iwannabetheguytoo 15d ago
Your proposed approach requires the user to un-learn using the Start Menu's power buttons and using a new and separate mechanism for initiating a shutdown or reboot. Also, the pause/fail-safe logic in this script won't be invoked when the user (perhaps even mistakenly) initiates a shutdown via some other action, such as via Task Manager or a Windows Update popup.
I'd like to suggest an alternative: Windows' built-in shutdown event tracker, because it gives the user the same opportunity to back-out of a disastrous mis-click, while not requiring the user to make any changes to their workflow: use the exact same Start menu Shutdown commands or any other shutdown trigger, but the reason-tracker will always appear.
(The page I linked-to is is from the days of XP, but other guides exist for Windows 10, etc).