Jump to content

How To Pause The Reboot Or Shutdown Of Windows


Recommended Posts

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!

Link to comment
Share on other sites

Link to comment
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?

Link to comment
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?

#)

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...