Jump to content

Shutdown with ease


Recommended Posts

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
Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...