Jump to content

Need help with timed shutdown function


8218
 Share

Recommended Posts

Greetings AutoIT community.

I' ve made the most of a script, but I need to finish it off.

The part that I need to do is a part that takes consideration to the current time (Windows time) and then shuts down the computer at a specific time.

So am I suposed to use a very big sleep function? Or is there any smart way to do it?

Thanks very much

Link to comment
Share on other sites

You could:

A: Call shutdown.exe from the command line (XP)

;60 seconds

shutdown -t 60

B: Loop continuously in AutoIt until @HOUR AND @MIN match the desired shutdown time

$sHour = 10
$sMin = 30

Do
Sleep(100)
Until @HOUR = $sHour AND @MIN = $sMin

Shutdown(1)

C: Add a an entry to the task scheduler to perform shutdown at specified date / time

https://www.microsoft.com/resources/documen...s.mspx?mfr=true

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