How to get out of hibernation if batch file repeating hibernation cmd?


  1. Posts : 5
    Windows 10
       #1

    How to get out of hibernation if batch file repeating hibernation cmd?


    Hello,

    I got myself into a bit of trouble here. I was writing a script to automatically abort shutdowns from Windows Updates. I was intending to use shutdown -a ("a" for abort) and set it to repeat every 15 minutes, but I wasn't paying attention. I accidentally put shutdown -h ("h" for hibernation) instead. To make matters worse, I set it to repeat every 15 milliseconds instead of every 15 minutes, so now it keeps going back into hibernation instantaneously as soon as I come out of it.

    I tried cutting the power completely including unplugging the cord to hopefully end the Windows session, but when Windows boots up it is still hibernating and the batch file starts executing automatically before I can see the desktop to do anything.

    I tried booting from the Windows 10 DVD and clicking Startup Repair, but it said it failed to repair the startup. Not sure if it has to do with the fact the computer is in hibernation mode. What else can I do with the Windows 10 DVD? I feel like the solution may be on there somewhere. There is a command prompt as one of the options, but I'm not sure what I would need to type or if that can even connect to the Windows session on the C drive. Any way to boot into safe mode from this DVD?

    I need to somehow close out that Windows session to stop the script but do not know how. It's like I gave myself a computer virus.

    I thankfully do have a second computer to work with (the one I am posting this from).

    Thanks for any help.
      My Computer


  2. Posts : 12,801
    Windows 11 Pro
       #2

    Have you tried an Admin command prompt and run powercfg -h off

    It will look like it didn't do anything but it turns hibernation off

    EDIT: never mind, I didn't see the full extent of your problem. Have you tried a system restore to a time before you ran the script or restore a backup image from before that happened?
      My Computer


  3. Posts : 12,801
    Windows 11 Pro
       #3

    Where is the batch file? You can use something like a live linux USB or Kyhi's Bootable rescue disk and edit or delete the batch file.
      My Computer


  4. Posts : 8,102
    windows 10
       #4

    If cmd prompt work just delete the batch file
      My Computer


  5. Posts : 5
    Windows 10
    Thread Starter
       #5

    I have fixed the issue by clicking the option to "Turn Off the PC" while using the Windows 10 DVD under repair options. I wasn't sure that would do anything but simply turn it off, only to restart and go back into hibernation, but it worked. It must have ended the hibernation mode.

    Thanks for the help anyways. Those seem like viable options.

    I did not try a restore point. I assumed I had restore points disabled so I didn't try it. It is possible I did not have it disabled though so that might have been another option had the "Turn off this PC" button not worked.

    You mentioned the Linux Live CD. I did try two different ones but oddly none of them would appear as a choice on the boot menu. Only the Windows 10 DVD would appear.

    Now I am curious. Now that hibernation is off, I am going to see if my computer can detect the Linux discs or if it was hibernation mode that was preventing them.
      My Computer


  6. Posts : 12,801
    Windows 11 Pro
       #6

    You may have to disable secure boot in BIOS
      My Computer


  7. Posts : 5
    Windows 10
    Thread Starter
       #7

    essenbe said:
    You may have to disable secure boot in BIOS
    You're right. Thanks for pointing that out. I would have been scratching my head for hours. Linux CDs are now bootable again.

    Back to writing my Abort Shutdown script. Hopefully nothing breaks.
      My Computer


  8. Posts : 12,801
    Windows 11 Pro
       #8

    Make a system image first with free Macrium. Use this tutorial.. You'll always have a 'way back' in case it messes up. many of us here do regular images with it so you can restore everything in case of any problem.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 18:24.
Find Us




Windows 10 Forums