Jump to content
Sign in to follow this  
kmps

How To Pause The Reboot Or Shutdown Of Windows

Recommended Posts

kmps

I am now writting a script which runs as Windows Service background (using SYSTEM account),and now I hope it can pause the reboot or shutdown of Windows so that it can finish some job before reboot or shutdown of Windows.Any good man can tell me how to get this.thanks a lot!

Share this post


Link to post
Share on other sites
blindwig

Share this post


Link to post
Share on other sites
kmps

but I don't know how to judge when to run this command to pause the reboot of Windows.

such as

If Windowsreboot()=1 or Windowsshutdown=1 then

run("shutdown -a")

EndIf

Have you tried "Shutdown -a" from the command prompt?

Share this post


Link to post
Share on other sites
nfwu

do
  RunWait("shutdown -a > C:\Temp\au3.temp.txt")
until FileRead("C:\Temp\au3.temp.txt", StringLen("Unable to abort the system shutdown because no shutdown was in progress.")) <> "Unable to abort the system shutdown because no shutdown was in progress."

Try that?

#)

Share this post


Link to post
Share on other sites
kmps

thank you,but there's still another problem,how to judge it's a reboot(not Power off) or a shutdown(Power off)?

and Further more,for Windows 2000 users,there's no command "shutdown" to use either.

Can Autoit get some system message when the Windows is going to shutdown and reboot?

do
  RunWait("shutdown -a > C:\Temp\au3.temp.txt")
until FileRead("C:\Temp\au3.temp.txt", StringLen("Unable to abort the system shutdown because no shutdown was in progress.")) <> "Unable to abort the system shutdown because no shutdown was in progress."

Try that?

#)

Edited by kmps

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.