Sign in to follow this  
Followers 0
jvanegmond

Shutdown with ease

8 posts in this topic

#1 ·  Posted (edited)

Shuts PC down after a given amount of seconds. If input is 0 will shut down immediately, if cancel or close is pressed cancel shutdown procedure.

Dim $answer

$answer = InputBox ( "Shutdown", "Please type the amount of seconds you want the pc to wait before shutting down ( leave 0 for immediately )" , "0" )

If $answer = "" Then
    Run("Shutdown -a")
Else
    Run("Shutdown -s -t " & $answer)
EndIf

Not much code but a usefull thingy to leave on your desktop.

Edit: Oops this should have go to Scripts and Scraps :o

Edited by Manadar

Share this post


Link to post
Share on other sites



Shuts PC down after a given amount of seconds. If input is 0 will shut down immediately, if cancel or close is pressed cancel shutdown procedure.

Dim $answer

$answer = InputBox ( "Shutdown", "Please type the amount of seconds you want the pc to wait before shutting down ( leave 0 for immediately )" , "0" )

If $answer = "" Then
    Run("Shutdown -a")
Else
    Run("Shutdown -s -t " & $answer)
EndIf

Not much code but a usefull thingy to leave on your desktop.

Edit: Oops this should have go to Scripts and Scraps :o

Why wouldn't you just use ShutDown() commands in the help file?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

cuz its alot simpler to use 1 line instead of ten. but thats still cool..

Share this post


Link to post
Share on other sites

Well .. why wouldn't you, haha

That makes no sense.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

That makes no sense.

i think he/she meant "well... why would'nt u use my script".

Share this post


Link to post
Share on other sites

the timer on his shutdown seems to be a nice effect...

i didn't notice that out ShutDown() has a timer...

maybe it should and/or could

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

the timer on his shutdown seems to be a nice effect...

i didn't notice that out ShutDown() has a timer...

maybe it should and/or could

8)

That would be a nice option I suppose if it worked like AdlibEnable()!! :o

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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