azwildcat Posted December 31, 2009 Posted December 31, 2009 I have a program where I have the option of clicking shutdown or rebooting after some maintenance. On XP systems, the reboot option does not work (it shuts down instead). The "Exit" is there as the program will try to go to the other options while shutting down if any other functions were clicked on the GUI while maintenance is runnnig and it gets noted in the log file. Here is the pertinent code below: Func _OnExit () GUICtrlSetData($progressbar, 100) If $OnExit = "Reboot" Then GUICtrlDelete ($Message) $MessageText = "Rebooting: " & @MON & "/" & @MDAY & "/" & @YEAR & " - " & @HOUR & ":" & @MIN & ":" & @SEC $Message = GUICtrlCreateLabel($MessageText, 64, 117) $ConfigureReadLog = FileOpen($log, 1) FileSetAttrib($log, "-R") _FileWriteLog($log,"Rebooting", 1) _FileWriteLog($log,"--------------Program Ending---------------", 1) FileSetAttrib($log, "+R") FileClose($ConfigureReadLog) Shutdown (14) Exit Else GUICtrlDelete ($Message) $MessageText = "Shutting Down: " & @MON & "/" & @MDAY & "/" & @YEAR & " - " & @HOUR & ":" & @MIN & ":" & @SEC $Message = GUICtrlCreateLabel($MessageText, 64, 117) $ConfigureReadLog = FileOpen($log, 1) FileSetAttrib($log, "-R") _FileWriteLog($log,"Shutting Down", 1) _FileWriteLog($log,"--------------Program Ending---------------", 1) FileSetAttrib($log, "+R") FileClose($ConfigureReadLog) Shutdown (13) Exit EndIf EndFunc
GEOSoft Posted December 31, 2009 Posted December 31, 2009 Unless Vista added some shutdown codes it shouldn't work on anything. Take a look at the Flag values again and show me a usable combination that totals 14. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
azwildcat Posted January 1, 2010 Author Posted January 1, 2010 Unless Vista added some shutdown codes it shouldn't work on anything. Take a look at the Flag values again and show me a usable combination that totals 14.2 = Reboot4 = Force8 = Power down= 14
somdcomputerguy Posted January 2, 2010 Posted January 2, 2010 14 is a bad flag combo. So I guess Vista reads it one way and XP reads it another way. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
GEOSoft Posted January 2, 2010 Posted January 2, 2010 2 = Reboot4 = Force8 = Power down= 14Reboot and Power Down are not compatable flags. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
azwildcat Posted January 2, 2010 Author Posted January 2, 2010 Reboot and Power Down are not compatable flags.Thanks George...change to Shutdown(6) and worked perfectly!
GodForsakenSoul Posted January 2, 2010 Posted January 2, 2010 Reboot = restart the computer. AKA, ctrl+alt+del; alt; u; r; as in, turn it off, and then on Power down = shut down COMPLETELY. what the hell are you trying to acheve here?
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