Jump to content

Shutdown


Gif
 Share

Recommended Posts

How Can I use the shutdown command [for example shutdown(2)] adding a timer that counts down the shutting of the pc?

Nothing visually...

$option = InputBox("Shutdown", "Option: 1 = Logoff 2 = Shutdown 3 = Reboot 4 = Power down 5= Suspend 6= Hibernate")

If $option = "" or $option < 1 or $option > 6 Then

MsgBox(48, "Error", "Wrong option", 5)

Exit

Else

$time = InputBox("Shoutdown time", "Enter time in seconds: ")

Sleep($time)

If $option = 1 Then

Shutdown(0)

ElseIf $option = 2 Then

Shutdown(1)

ElseIf $option = 3 Then

Shutdown(2)

ElseIf $option = 4 Then

Shutdown(8)

ElseIf $option = 5 Then

Shutdown(32)

ElseIf $option = 6 Then

Shutdown(64)

EndIf

EndIf

Exit

Hope it helps

Edited by searchresult
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...