Jump to content

Recommended Posts

Posted

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!

Posted

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?

Posted

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?

#)

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

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
  • Recently Browsing   0 members

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