kmps Posted May 4, 2006 Posted May 4, 2006 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!
blindwig Posted May 4, 2006 Posted May 4, 2006 Have you tried "Shutdown -a" from the command prompt? My UDF Threads:Pseudo-Hash: Binary Trees, Flat TablesFiles: Filter by Attribute, Tree List, Recursive Find, Recursive Folders Size, exported to XMLArrays: Nested, Pull Common Elements, Display 2dSystem: Expand Environment Strings, List Drives, List USB DrivesMisc: Multi-Layer Progress Bars, Binary FlagsStrings: Find Char(s) in String, Find String in SetOther UDF Threads I Participated:Base64 Conversions
kmps Posted May 4, 2006 Author Posted May 4, 2006 but I don't know how to judge when to run this command to pause the reboot of Windows.such asIf Windowsreboot()=1 or Windowsshutdown=1 thenrun("shutdown -a")EndIfHave you tried "Shutdown -a" from the command prompt?
nfwu Posted May 4, 2006 Posted May 4, 2006 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? #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode()
kmps Posted May 4, 2006 Author Posted May 4, 2006 (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 May 4, 2006 by kmps
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now