Sign in to follow this  
Followers 0
Gif

Shutdown

4 posts in this topic

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

Nothing visually...

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

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

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