tonycst Posted August 23, 2013 Share Posted August 23, 2013 (edited) While back i coded my self simple script to shut down computer after countdown reaches 0. see attachment ShutDowner.au3 Never had problems using it at all. Recently i noticed that my computer will not power up after i use this shutdowner. My only hardware change was SSD drives. Other then that, computer is 100% same hardware and software. If i use normal windows shutdown function or press power button, no problems occure, but when i use shutdowner, computer wont power up. It starts to power up but lights keep blinking as if it doesnt have enough power. It continues to attemp to power up but it never stops. Holding power button makes it shut down, but does not help. The only thing helps is to unplug computer from the 120v line and press power button. Then it will start normaly once plugged back in. What do you guys think may cause this ? Normaly computer shuts down with no problems, but using shutdowner it fails to power up. Perhaps new version of autoit has it fixed ? My script is over 1 year old. What is the difference betwin shutdown and powerdown ? Maybe i script needs a change in that way ? Edited August 23, 2013 by tonycst Link to comment Share on other sites More sharing options...
Kidney Posted August 23, 2013 Share Posted August 23, 2013 i never liked when i program shutdown my computer for me. they never end well. in your case they dont start well. i have just resorted to hibernate. however, i would like to share a little program that i made not too long ago NetworkSpeed.au3 it simple monitors your network speed and system idle time. if the network connection sits under 100 kbp/s (you could change this to be higher/lower) for 5 minute (again, could be changed) and the system has been idle for 5 minutes as well, the script will start to hibernate. my script has no gui because it was designed to run in the background and not really effect the user. you could implement a portion of my script into yours if you would like. sorry i couldnt help with your shutdown problem tho Link to comment Share on other sites More sharing options...
abberration Posted August 23, 2013 Share Posted August 23, 2013 Without your hardware to test on, I would suggest using ("option", 9). Option 9 is options 1 + 8 which is equal to Shutdown + Power down. To me, it sounds like your computer is going into a sleep mode that it cannot come out of, so also specifying a power down may be more of a complete shutdown process. Easy MP3 | Software Installer | Password Manager Link to comment Share on other sites More sharing options...
TheSaint Posted August 24, 2013 Share Posted August 24, 2013 (edited) @tonycst - That's a rather large body of code to go through, how about you paraphrase the relevant section/s here, using the Forum's AutoIt code tags. Interesting the way you've used the Assign command. I've never seen it used so comprehensively that way before. Why didn't you just use the simpler $option = 1 etc method? P.S. I only had the briefest look at your code, and none of it completely or in detail. What abberration has said, may be all you need to do. Are you also forcing any existing processes to close? Edited August 24, 2013 by TheSaint Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
tonycst Posted August 25, 2013 Author Share Posted August 25, 2013 I my self dont see any other use for "assign" Buttom line of the code is Shutdown($option,$reason) where $option is assigned as you click things. not too complicated. Forcing or no forcing, does not seem to effect. I think my 4-5 year old power supply is dying. Maybe thats why. Link to comment Share on other sites More sharing options...
kylomas Posted August 25, 2013 Share Posted August 25, 2013 (edited) tonycst, The assign/eval pair have some very specific uses. Your code would be better served with simple assignment ($option = 1) Have you tried changing $optionShutDown = GUICtrlCreateRadio("ShutDown", 170, 40) If $ReadLastAction = "ShutDown" Then GUICtrlSetState (-1,$GUI_CHECKED) GUICtrlSetData ($optionInput,"ShutDown") Assign ("option",1) EndIf to $optionShutDown = GUICtrlCreateRadio("ShutDown", 170, 40) If $ReadLastAction = "ShutDown" Then GUICtrlSetState (-1,$GUI_CHECKED) GUICtrlSetData ($optionInput,"ShutDown") Assign ("option",9) EndIf as suggested earlier? kylomas edit: additional info - tonycst, there are examples of some uses of "isdeclared", "assign" and "eval" in >this thread. Edited August 25, 2013 by kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
TheSaint Posted August 26, 2013 Share Posted August 26, 2013 (edited) I my self dont see any other use for "assign" It is one way to create multiple variables on the fly, as in a For ... Next statement or other Loop statement, especially for joining one or more variables or text together. i.e. For $a = 1 To 10 Assign("Checkbox_" & $a, 1) Next Edited August 26, 2013 by TheSaint Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
willichan Posted August 26, 2013 Share Posted August 26, 2013 (edited) My only hardware change was SSD drives. Other then that, computer is 100% same hardware and software. SSD drives are more sensitive to how their power gets cut than a platter drive. In order to prevent corruption to the drive's contents, many SSD drives (I use Crucial) have a built in "protection mode" when it detects a power fluctuation. In a laptop, sleep mode triggers this at times. Because of this, I would recommend not using a scripted power-off with an SSD drive. To recover the drive, the following procedure sounds dumb, but came from Crucial when we thought we had an epidemic of dying SSD drives. Power off the PC, and leave it off for 10 minutes. Power on the PC, and leave it powered on for 10 minutes (ignoring any errors the PC is giving you) Power the PC back off, and disconnect all cables from the drive for >30 seconds Reconnect and power on your PC. It is also recommended to change your power save settings to not spindown or sleep your SSD hard drive. It doesn't have anything to spindown anyway, so there is no power savings in doing it. It will just cause problems. --edit-- added quote Edited August 26, 2013 by willichan My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash Link to comment Share on other sites More sharing options...
jchd Posted August 26, 2013 Share Posted August 26, 2013 A completely distinct experience of mine: I still have (somewhere, I hope) a very basic PC which will do exactly the same thing (hang on reboot) after WU (Windows Update) reboots the PC after forcing updates to take place. I used to run my machines 24/7 and I sometimes leave one of them in "install updates auto-diabolically" mode. When that happens on this particular PC, it hangs at reboot stage and only a cold boot will work. It has no SSD no fancy graphics or add-on board: just stock MSI motherboard powered by some 2-core Intel CPU, 2 or 3 SATA disks and a Gb network card. Probably a BIOS artifact. Your issue may be "as simple as" that. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Administrators Jon Posted August 26, 2013 Administrators Share Posted August 26, 2013 Do a one line shutdown command and see what happens. It's pointless trying to debug a massive script if your actual question is "Is the Shutdown() function in autoit bugged". Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
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