topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday March 29, 2024, 1:21 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Is there any way to abort a reboot?  (Read 5086 times)

urlwolf

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,837
    • View Profile
    • Donate to Member
Is there any way to abort a reboot?
« on: February 02, 2007, 11:08 AM »
Hmm,
Is there any way to abort a reboot? I sometimes hit a reboot button by accident in vista start menu and dunno how to stop the process.

Is it possible?

nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,119
    • View Profile
    • Donate to Member
Re: Is there any way to abort a reboot?
« Reply #1 on: February 02, 2007, 02:08 PM »
can't you change the layout of the menu to prevent it happening?

Darwin

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 6,984
    • View Profile
    • Donate to Member
Re: Is there any way to abort a reboot?
« Reply #2 on: February 02, 2007, 05:26 PM »
Excellent question, urlwolf. I've always wondered (but wondering never turned to asking...) if it was possible to abort a reboot/shutdown.

cthorpe

  • Discount Coordinator
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 738
  • c++thorpe
    • View Profile
    • Donate to Member
Re: Is there any way to abort a reboot?
« Reply #3 on: February 02, 2007, 05:36 PM »
Windows XP has a command shutdown.exe that looks like it would work:

Usage: shutdown.exe [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-
c "comment"] [-d up:xx:yy]

        No args                 Display this message (same as -?)
        -i                      Display GUI interface, must be the first option
        -l                      Log off (cannot be used with -m option)
        -s                      Shutdown the computer
        -r                      Shutdown and restart the computer
        -a                      Abort a system shutdown
        -m \\computername       Remote computer to shutdown/restart/abort
        -t xx                   Set timeout for shutdown to xx seconds
        -c "comment"            Shutdown comment (maximum of 127 characters)
        -f                      Forces running applications to close without warning
        -d [ u][p]:xx:yy         The reason code for the shutdown
                                u is the user code
                                p is a planned shutdown code
                                xx is the major reason code (positive integer less than 256)
                                yy is the minor reason code (positive integer less than 65536)

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Is there any way to abort a reboot?
« Reply #4 on: February 02, 2007, 06:06 PM »
Thing is that at a point during reboot/shutdown, windows won't let you launch new processes - you mostly see this if the system is in a limbo state because of a process that won't shut down.

So, generally, I'd say that it isn't feasible to abort shutdown - except for things like "critical service <bleh> has been nuked yadda yadda" (ie, what you get for a failed attack by the blaster worm or whatever).
- carpe noctem

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: Is there any way to abort a reboot?
« Reply #5 on: February 02, 2007, 06:40 PM »
[blah]
I noticed i was going to say exactly what f0dder said.
I agree, no way to stop shutdown after it has started, you can only stop that timer before shutdown.
If you run the command that cthorpe mentioned, you get a "can't launch 'shutdown' because the workstation is shuting down". Also, if you have a computer that is fast enough, it'll probably shutdown before you can do something.

On the other hand, i've seen a bunch of programs that can stop windows shutdown (a feature that i find MOST anoying). This means that processes that are already running can stop the shutdown. Anyone has any idea on how to do it?

cthorpe

  • Discount Coordinator
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 738
  • c++thorpe
    • View Profile
    • Donate to Member
Re: Is there any way to abort a reboot?
« Reply #6 on: February 02, 2007, 06:46 PM »
alright, so I didn't test it before I posted it  :redface:


app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,884
    • View Profile
    • Donate to Member
Re: Is there any way to abort a reboot?
« Reply #7 on: February 02, 2007, 07:33 PM »
On the other hand, i've seen a bunch of programs that can stop windows shutdown (a feature that i find MOST anoying). This means that processes that are already running can stop the shutdown. Anyone has any idea on how to do it?

If you are referring to programs that won't allow Windows to shutdown when you want to shutdown, that is the fault of the programmer that coded it, not handling shutdown messages properly.

It's not a feature...it's an application bug.

This is usually an issue with tray applications or windows that minimize to tray rather than closing when you click the X. There is extra stuff you have to do in case the user wants to logoff/shutdown/reboot while your app is still running, or it will cause Windows to hang and not shutdown.

It was something I had to learn about and make sure wouldn't happen with Instant Boss when I was coding it, because I minimized it to tray instead of closing when a user clicks the X.

This page should tell you what you need to know about it:
http://msdn2.microso...ibrary/aa376884.aspx

I don't know if it can be done (and I wouldn't know how any way), but it might be possible to write an AHK script that would be specific to your situation and misbehaving apps, that would somehow close those naughty apps first by simulating the user clicking 'exit' from their tray icon menus...and then logoff, shutdown or reboot Windows for you.

Then you would just use that instead of the normal shutdown shortcut in the start menu.


jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: Is there any way to abort a reboot?
« Reply #8 on: February 02, 2007, 07:40 PM »
Actually, app, that's not the case.
I don't mean apps that make the system hang and that windows has to terminate the processes to shutdown. The app i'm referring is indeed minimized to the tray and when i shutdown the system with it running, the app can somehow cancel the shutdown and asks me if i want to quit. If i press "yes", it exits but still, the computer doesn't shutdown and acts as normal, since the shutdown order was canceled. I have to give the shutdown order again. (btw, this is a vodafone mobile connect card software, controls those things that allow you to have internet connection on the move).
I never understood exactly how they can do this. It could be the solution to the problem mentioned above, though.

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Is there any way to abort a reboot?
« Reply #9 on: February 03, 2007, 01:26 AM »
It's not a feature...it's an application bug.
-app103
Actually, you could say it's a mix :)

The whole WM_QUERYENDSESSION/WM_ENDSESSION deal is pretty nice, without it apps would be terminated without a chance to save unsaved data (and shutdown wouldn't be halted if you hit "cancel" on a save request).

If an application is hung and doesn't reply to the messages, the shutdown process will hang for a while (but there's some timeouts, and those can be tweaked).
- carpe noctem