Sign in to follow this  
Followers 0
kmps

How To Pause The Reboot Or Shutdown Of Windows

5 posts in this topic

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



Share this post


Link to post
Share on other sites

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

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

#5 ·  Posted (edited)

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  
Followers 0