Jump to content

Run Script Everyday


 Share

Recommended Posts

  • Moderators

How would I fully Automate it though?

What exactly are you asking?

Did you write something already and you just want to run at certain times of the day?

AdlibEnable() + _YourCustomFunctionToCheckTime + Condition Statement if time is good to go to your other functions.

Or make your own task scheduler (pointless if you ask me) that will have to always be running on the PC to run at certain times/days.

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

What exactly are you asking?

Did you write something already and you just want to run at certain times of the day?

AdlibEnable() + _YourCustomFunctionToCheckTime + Condition Statement if time is good to go to your other functions.

Yes I have wrote something already but can you give me an example to what you said

:)

Link to comment
Share on other sites

For example, let's say you want your script to run everyday at 9.30 PM:

$hour=21
$minutes=30
$seconds=0
$exit=0
Do
    Sleep(100)
    If $hour=@HOUR And $minutes=@MIN And $seconds=@SEC Then
        $exit=1
    EndIf
Until $exit=1

MsgBox(0,"","Time to do your stuff!")

Of course that you would have to run your script every time you turn on your pc. Or you could just create a shortcut to the compiled script at

C:\Documents and Settings\User\Start Menu\Programs\Start (Should be something like this, mine is in Spanish). This way your app will run after Windows starts.

Edited by Nahuel
Link to comment
Share on other sites

For example, let's say you want your script to run everyday at 9.30 PM:

$hour=21
$minutes=30
$seconds=0
$exit=0
Do
    Sleep(100)
    If $hour=@HOUR And $minutes=@MIN And $seconds=@SEC Then
        $exit=1
    EndIf
Until $exit=1

MsgBox(0,"","Time to do your stuff!")

Of course that you would have to run your script every time you turn on your pc. Or you could just create a shortcut to the compiled script at

C:\Documents and Settings\User\Start Menu\Programs\Start (Should be something like this, mine is in Spanish). This way your app will run after Windows starts.

One thing to note, with this script it will be absorbing some CPU usage and memory, so if you are going to do this, keep it really short and simple. KISS. When it's time to "Do the stuff" you should have it ShellExecute or Run your EXE that you've got already. You don't want to put this at the top of a 3,000 line script.
Link to comment
Share on other sites

put this in C:\autoexec.bat, or if you dont have it, make it in notepad:

C:

cd "\program files\directory\"

at 21:00 start "" yourscript.exe

Change C: to whatever drive your file is on

Change "\program files\directory\" to the path to your file

Change the 21:00 to whatever time you want it to start

This is probably the simplest way to automatically run it....

Link to comment
Share on other sites

autoexec.bat is often disabled on XP systems. You can't rely on it to execute, unless it's your own system only.

I wish the original poster would give more information; there are loads of good *possible* answers to this.

;o)

(or

nothing is foolproof to the sufficiently talented fool..

Link to comment
Share on other sites

For example, let's say you want your script to run everyday at 9.30 PM:

$hour=21
$minutes=30
$seconds=0
$exit=0
Do
    Sleep(100)
    If $hour=@HOUR And $minutes=@MIN And $seconds=@SEC Then
        $exit=1
    EndIf
Until $exit=1

MsgBox(0,"","Time to do your stuff!")oÝ÷ ØçÜ¢êìzØZ·*.Â¥v¯zÚ+º|¨º»®*mz÷«Êئ{*.¶êç¢|¨ºº:¼¨¹Ê.Øî²×+^jÈh®×.¶Ú-ç(¥yÛ®*mjØÓݡ˦z{ljwRzÛb4÷e,=Ù+Z®Óí=Øú趦³OvJÖ«·ø¥u·¬¢g­)à)¶¬)ÞȧJ§ÈS+0k,¨º¶©§¥»§iû^­h§v,²Ö«¶Ïêº^:{ay:)Ê(r¥v}ý·*.ë-vaÆ®¶­sbb33c¶÷W#Ó#¢b33c¶ÖãÓ3¢b33c·6V3Ó¤Fð 6ÆVW¥VçFÂ÷W#Òb33c´õU"æBÖãÒb33c´ÔâæB6V3Òb33cµ4T2²Æ¶RFòWBFR6æværöæR#BgV÷C³ÒgV÷C²§ ¤×6t&÷ÂgV÷C²gV÷C²ÂgV÷CµFÖRFòFò÷W"7GVfbb333²gV÷C²
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...