Jump to content
Sign in to follow this  
8218

Need help with timed shutdown function

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

Share this post


Link to post
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

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  

×
×
  • Create New...