Prevent Windows shutdown


  1. Posts : 23
    Windows 7 Home Premium 64bit
       #1

    Prevent Windows shutdown


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


  2. Posts : 3,615
    Win 10 x64, Linux Lite, Win 7 x64, BlackArch, & Kali
       #2

    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 Computer


  3. Posts : 2
    Windows 7 Ultimate x32
       #3

    Instructions:



    https://www.howtogeek.com/howto/wind...windows-vista/


    Abort shortcut:



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


    Start in:C:\Windows\system32


    choose icon:%SystemRoot%\system32\SHELL32.dll
      My Computer


  4. Posts : 3,615
    Win 10 x64, Linux Lite, Win 7 x64, BlackArch, & Kali
       #4

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


  5. Posts : 4,751
    Windows 7 Home Premium 32-Bit - Build 7600 SP1
       #5

    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 Computer


  6. Posts : 3,615
    Win 10 x64, Linux Lite, Win 7 x64, BlackArch, & Kali
       #6

    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 (*.*)
    shutdown.bat
    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 Icon.zip
    Last edited by Snick; 23 Apr 2019 at 07:31. Reason: add regedit info
      My Computer


  7. Posts : 6,021
    Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
       #7

    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 Computer


  8. Posts : 1,363
    Win7 pro x64
       #8

    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

    #a::
    Run shutdown -a
    return

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

    Beginner Tutorial | AutoHotkey
      My Computer


 

  Related Discussions
Our Sites
Site Links
About 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 10:13.
Find Us