Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Prevent Windows shutdown

20 Apr 2019   #1
Master Po

Windows 7 Home Premium 64bit
Prevent Windows shutdown

How is possible to stop windows shutdown if I accidentally click Shutdown in start menu?

My System SpecsSystem Spec
20 Apr 2019   #2

Win 10 x64, Linux Lite, Win 7 x64, BlackArch, & Kali

Hi Master Po,

Command line
batch file terminate shutdown
batch file shutdown with error trap
change shutdown button to sleep

What's your flavor?
My System SpecsSystem Spec
20 Apr 2019   #3

Windows 7 Ultimate x32


Abort shortcut:

Target:C:\Windows\System32\shutdown.exe -a

Start in:C:\Windows\system32

choose icon:%SystemRoot%\system32\SHELL32.dll
My System SpecsSystem Spec

20 Apr 2019   #4

Win 10 x64, Linux Lite, Win 7 x64, BlackArch, & Kali

Here's a shutdown and restart batch file with yes check before action & shutdown.ico icon
Shutdown Batch File with
open zip & open READ ME FIRST

My System SpecsSystem Spec
23 Apr 2019   #5

Windows 7 Home Premium 32-Bit - Build 7600 SP1

I have accidently hit Shutdown instead of Log Off before. How is there time to run any of the aborts above? You have maybe five seconds until Shutdown. Just curious.
My System SpecsSystem Spec
23 Apr 2019   #6

Win 10 x64, Linux Lite, Win 7 x64, BlackArch, & Kali

5 seconds isn't enough time.
If you look at the batch file I uploaded, right-click edit, look for
Shutdown -r -f -t 5
Shutdown -s -f -t 5

-t is shutdown timer in seconds, currently 5.
both places, change to seconds you wish
save as type: All files (*.*)
that saves it as it is, a batch file

Here's the regedit:
If you don't feel totally comfortable editing this key, backup the registry, or full disk image backup to be on the safe side.
Registry - Backup and Restore - Windows 7 Help Forums
  1. Click type regedit
  2. Click regedit.exe when it appears
  3. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
  4. In the right pane, double-click WaitToKillServiceTimeout
  5. Change it to what you wish; default is 10000 is 10 seconds, 15000 is 15 seconds, 20000 is 20 seconds, etc.
  6. Click OK
  7. Close the folder levels you opened to return to where you began. (Computer and 5 folders below)
Shutdown set to 15 seconds
15 Second Shutdown Batch File with

My System SpecsSystem Spec
2 Weeks Ago   #7
Paul Black

Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3

Hi Snick,

The READ ME files in both your batch files are of the File type. It might be better to make them .txt files so the user doesn't have to select a program to open them with!
My System SpecsSystem Spec
2 Weeks Ago   #8

Win7 pro x64

Just create a hotkey shortcut. I hate the built in windows hot keys because you have to press ctl and alt plus another key, which is hard to do very quickly. I suggest you use autohotkey and create just one file called "abort.ahk", which contains only this

Run shutdown -a

which maps the keyboard combination of windowskey+a to run an immediate shutdown abort

Beginner Tutorial | AutoHotkey
My System SpecsSystem Spec

 Prevent Windows shutdown

Thread Tools

Similar help and support threads
Thread Forum
Prevent shutdown when not initiated by user
How do I do to prevent a shutdown from being initiated by means that was not my own action? I have already had multiple issues with programs that work with DB's on my computer (including my own) that become partly corrupted from being given the order to shutdown and then the process is killed...
General Discussion
Windows has shutdown to prevent damage blue screen error
About a week ago I noticed my computer became uncharacteristically slow, so I ran a full computer virus scan to check for infections and nothing turned up. Yesterday I found the culprit of the slow down, it was a process called "system interrupts" it was using 25% of my processor all the time....
BSOD Help and Support
Sidebar prevent computer shutdown!
After a fresh SP1 install (with all updates) i encounter this (quite common apparently..) which is the sidebar freezing during shutdown and altering its process. So far i couldn't fix this. Probably some will respond "just turn off that sh**" but no i have some nice (and clean) widget i wanna...
General Discussion
Prevent Shutdown ????????????????????
I have to do a lot of works on my PC. But my son also play games from another standard user account. So he always shutdown my PC and I loose all my works. So is there any way to prevent shutdown while other users are logged on.
General Discussion
Programming: How to prevent shutdown using VB?
Hello, sorry if i post in wrong thread. I'm in project to build an i-cafe software for my own i-cafe. I need the code to prevent windows 7 for shutdown if my application still running. My current code work fine in windows xp without any problem, but not in vista and 7. There are anyone here can...
General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 22:11.
Twitter Facebook