Aborting a shutdown

DevilsbaneDevilsbane Member Posts: 4,214 ■■■■■■■■□□
Is there any way to stop a shutdown after it has already started?

A coworker of mine thinks he is all fancy by turning off his computer at the end of the day using the shutdown -r command and leaving all of his apps open. I keep trying to get in there with the shutdown -a to abort the shutdown but he is clever and leaves very little time on the clock.

So once the shutdown has begun, is there a way to stop it? Maybe a process to kill or something like that? He leaves all of his apps open so there is about 30+ seconds between the shutdown starting and explorer going away.
Decide what to be and go be it.

Comments

  • humdingy02humdingy02 Member Posts: 35 ■■□□□□□□□□
    If you don't have time to WindowKey-R and type shutdown /a, then there probably isn't time to kill a process. (isn't shutdown /r a reboot and not a shutdown?)
    However: I used to abort shutdowns in XP all the time (virus or whatever), but I seem to remember trying this a while back on a Win7 computer that was shutting down and it didn't work. Maybe something has changed?
    WGU - BS, IT Security (starting Feb 1st, 2012)
    Remaining: LUT1,QBT1,DFV1,BOV1,HHT1,QLT1,RIT1,IWC1,IWT1,DJV1,KET1,TPV1,MGC1,CVV1,CJV1,KFT1,CNV1,SBT1,RGT1
    Completed: WFV1,CLC1,INT1,CUV1,CQV1,BNC1,GAC1
    Transferred: AGC1,BBC1,LAE1,AXV1,CPV1,INC1,CSV1,COV1,CTV1,DHV1,BVC1
  • DevilsbaneDevilsbane Member Posts: 4,214 ■■■■■■■■□□
    humdingy02 wrote: »
    If you don't have time to WindowKey-R and type shutdown /a, then there probably isn't time to kill a process. (isn't shutdown /r a reboot and not a shutdown?)
    However: I used to abort shutdowns in XP all the time (virus or whatever), but I seem to remember trying this a while back on a Win7 computer that was shutting down and it didn't work. Maybe something has changed?

    Yes, /r is reboot but the computer still shutsdown, it just comes back up too.

    I also recall having some troubles with this on windows 7 but was able to solve it. Maybe it needs an elevated prompt or something, I forget icon_sad.gif

    The point is that the shutdown /a only works while the countdown is in progress. Once it hits 0 the computer begins to shutdown and running this command is useless. However the computer is still on and I still have some control over it (launching apps usually fail to initialize because it knows that the computer is shutting down).
    Decide what to be and go be it.
  • pzeropzero Member Posts: 192
    You could always start making WMI calls to his machine thru the day and start killing random processes icon_biggrin.gif
  • RobertKaucherRobertKaucher Member Posts: 4,299 ■■■■■■■■■■
    Devilsbane wrote: »
    Is there any way to stop a shutdown after it has already started?

    A coworker of mine thinks he is all fancy by turning off his computer at the end of the day using the shutdown -r command and leaving all of his apps open. I keep trying to get in there with the shutdown -a to abort the shutdown but he is clever and leaves very little time on the clock.

    So once the shutdown has begun, is there a way to stop it? Maybe a process to kill or something like that? He leaves all of his apps open so there is about 30+ seconds between the shutdown starting and explorer going away.
    If you want to play a joke on him do this: Install the SysInternals suite, then run this command:
    psexec [URL="file://\\computername"]\\computername[/URL] -i -d -c "sysinternals bluescreen.scr" /s
    

    It will copy the BSoD screen saver to his PC and run it. So do it while he is taking a break. When he comes back he will think his PC is boot looping.

    EDIT:
    Well, it has not been updated for 7 and is not included in the suite. You can get it from Sysinternals page, though.
  • blargoeblargoe Member Posts: 4,174 ■■■■■■■■■□
    One time I put a script to eject the CD tray in the scheduled tasks of a coworker's laptop. When it popped out for the first few times, I made like I was controlling it from my desk, but it was really just executing every 37 minutes or something odd like that. I knew he'd be working from home that night, so I left the task in there. Freaked him the hell out when he was home and it kept happening.

    "How did you keep ejecting my drive? I wasn't even on the VPN!!!"
    IT guy since 12/00

    Recent: 11/2019 - RHCSA (RHEL 7); 2/2019 - Updated VCP to 6.5 (just a few days before VMware discontinued the re-cert policy...)
    Working on: RHCE/Ansible
    Future: Probably continued Red Hat Immersion, Possibly VCAP Design, or maybe a completely different path. Depends on job demands...
  • CodeBloxCodeBlox Member Posts: 1,363 ■■■■□□□□□□
    I've only known the "shutdown -a" method but I do know that it doesn't work after the timer elapses. Sorry I can't be of more help :P
    Currently reading: Network Warrior, Unix Network Programming by Richard Stevens
  • pzeropzero Member Posts: 192
    Just thinking about this for you....

    As long as the guy is using XP (not tested on Vista/7) and isnt using -f (force) in his shutdown command and you have access to his machine during the shutdown timer..

    what you can do is open notepad, whack in a bunch of rubbish text and when the counter hits 0 and attempts to reboot, notepad will ask if you want to save the document, then give you the End Task dialog. From there you can "cancel, cancel". Shutdown aborted.

    Or just rename shutdown.exe. Windows Protection will kick in doing that tho.
  • pzeropzero Member Posts: 192
    blargoe wrote: »
    One time I put a script to eject the CD tray in the scheduled tasks of a coworker's laptop. When it popped out for the first few times, I made like I was controlling it from my desk, but it was really just executing every 37 minutes or something odd like that. I knew he'd be working from home that night, so I left the task in there. Freaked him the hell out when he was home and it kept happening.

    "How did you keep ejecting my drive? I wasn't even on the VPN!!!"


    LOL - funny stuff.
  • demonfurbiedemonfurbie Member Posts: 1,819 ■■■■■□□□□□
    well i dont know if this will work for you but you can make a macro to open up word pad and type a space and if he isnt around to hit no on the "do you want to save this document" shutdown will stall, you just may have to have it open multi wordpads way like 60 or so all with 1 space.
    wgu undergrad: done ... woot!!
    WGU MS IT Management: done ... double woot :cheers:
  • crrussell3crrussell3 Member Posts: 561
    If he only uses shutdown /a, it defaults to 30 seconds. If it was me, I would create a scheduled task (or psexec the batch file to him) that starts maybe 5 or so minutes before he typically leaves work, and have it run a batch file like so:

    shutdown /a
    PAUSE 25
    shutdown /a
    PAUSE 25

    and keep repeating that sequence long enough to cover when he would leave. Granted, he might notice the shutdown window going away if it happens to fire off at the right time, but, you might get lucky!
    MCTS: Windows Vista, Configuration
    MCTS: Windows WS08 Active Directory, Configuration
  • rsuttonrsutton Member Posts: 1,029 ■■■■■□□□□□
    You can use the shutdown command on a remote machine so I assume you could use shutdown /a on a remote machine as well. That would take care of the whole time factor thing.
  • DevilsbaneDevilsbane Member Posts: 4,214 ■■■■■■■■□□
    crrussell3 wrote: »
    If he only uses shutdown /a, it defaults to 30 seconds. If it was me, I would create a scheduled task (or psexec the batch file to him) that starts maybe 5 or so minutes before he typically leaves work, and have it run a batch file like so:

    shutdown /a
    PAUSE 25
    shutdown /a
    PAUSE 25

    and keep repeating that sequence long enough to cover when he would leave. Granted, he might notice the shutdown window going away if it happens to fire off at the right time, but, you might get lucky!

    haha this seems like a good idea. I'll have to script it out but I think I'll get it down to a 5 second gap and use a loop to prevent an early onset of Carpal Tunnel!

    By the way, pause 25 just does a pause. You're looking for sleep 25.
    Decide what to be and go be it.
  • DevilsbaneDevilsbane Member Posts: 4,214 ■■■■■■■■□□
    @echo off
    set x=0
    :Shutdownz
    shutdown /a
    sleep 5
    set /a X+=1
    if %x%==60 (exit)
    goto Shutdownz
    

    Giving this a try tonight! Might add an output redirect to NULL on the sleep statement. We'll see.
    Decide what to be and go be it.
  • crrussell3crrussell3 Member Posts: 561
    Devilsbane wrote: »
    @echo off
    set x=0
    :Shutdownz
    shutdown /a
    sleep 5
    set /a X+=1
    if %x%==60 (exit)
    goto Shutdownz
    
    Giving this a try tonight! Might add an output redirect to NULL on the sleep statement. We'll see.

    Looks good. Ha! Just realized I put pause instead of sleep :) I would psexec this guy when he is close to leaving and you should be good.
    MCTS: Windows Vista, Configuration
    MCTS: Windows WS08 Active Directory, Configuration
  • crrussell3crrussell3 Member Posts: 561
    Devilsbane wrote: »
    By the way, pause 25 just does a pause. You're looking for sleep 25.

    Ya it's a Monday. Need more caffeine!
    MCTS: Windows Vista, Configuration
    MCTS: Windows WS08 Active Directory, Configuration
  • DevilsbaneDevilsbane Member Posts: 4,214 ■■■■■■■■□□
    This will have to wait until tomorrow, he just locked his computer.

    I decided to run it anyway, and it failed out. Sleep is not a recognized command because he doesn't have the resource kit installed. Small detail that I will have to plan for.

    EDIT: Copied the sleep.exe program to the same directory as my batch file.
    Decide what to be and go be it.
  • demonfurbiedemonfurbie Member Posts: 1,819 ■■■■■□□□□□
    Devilsbane wrote: »
    This will have to wait until tomorrow, he just locked his computer.

    I decided to run it anyway, and it failed out. Sleep is not a recognized command because he doesn't have the resource kit installed. Small detail that I will have to plan for.

    EDIT: Copied the sleep.exe program to the same directory as my batch file.

    dont forget to hide your folder and make sure show hidden files/folders is turned off on his station
    wgu undergrad: done ... woot!!
    WGU MS IT Management: done ... double woot :cheers:
  • DevilsbaneDevilsbane Member Posts: 4,214 ■■■■■■■■□□
    dont forget to hide your folder and make sure show hidden files/folders is turned off on his station

    It's hidden in a program files folder. He shouldn't have any reason to be navigating over there.
    Decide what to be and go be it.
  • mikedisd2mikedisd2 Member Posts: 1,096 ■■■■■□□□□□
    Devilsbane wrote: »
    A coworker of mine thinks he is all fancy by turning off his computer at the end of the day using the shutdown -r command and leaving all of his apps open. I keep trying to get in there with the shutdown -a to abort the shutdown but he is clever and leaves very little time on the clock.

    Maybe you should tell your coworker to find a girlfriend.
Sign In or Register to comment.