Jump to content
Sign in to follow this  
tonycst

shutdown function make computer unable to power up

Recommended Posts

tonycst

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 by tonycst

Share this post


Link to post
Share on other sites
Kidney

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

 

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 :ermm:

Share this post


Link to post
Share on other sites
abberration

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.


RAID Calculator | Software Installer

The truth has been suppressed since the dawn of time.

Share this post


Link to post
Share on other sites
TheSaint

@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 by TheSaint

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

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)

userbar.png

Share this post


Link to post
Share on other sites
tonycst

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.

Share this post


Link to post
Share on other sites
kylomas

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 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

Share this post


Link to post
Share on other sites
TheSaint

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 by TheSaint

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

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)

userbar.png

Share this post


Link to post
Share on other sites
willichan

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 by willichan

Share this post


Link to post
Share on other sites
jchd

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 here
RegExp tutorial: enough to get started
PCRE 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)

Share this post


Link to post
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
Sign in to follow this  

×