Sign in to follow this  
Followers 0
Walls192

Run Script Everyday

17 posts in this topic

How would I run my script everyday?

Share this post


Link to post
Share on other sites

:)

Start-->Control Panel-->Scheduled tasks?

Share this post


Link to post
Share on other sites

:)

Start-->Control Panel-->Scheduled tasks?

How would I fully Automate it though?

Share this post


Link to post
Share on other sites

:)

Start-->Control Panel-->Scheduled tasks?

Hahahah... ;)

Share this post


Link to post
Share on other sites

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.

Share this post


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

:)

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

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

Share this post


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

Share this post


Link to post
Share on other sites

Yeah that's true. Good point.

Share this post


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

Share this post


Link to post
Share on other sites

Could I make the bat file silently within the script?

Share this post


Link to post
Share on other sites

Could I make the bat file silently within the script?

nono

autoexec.bat is a bat file that automatically executes on system startup. Thus the name...

Share this post


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

Share this post


Link to post
Share on other sites

how about put the script in system startup

Share this post


Link to post
Share on other sites

Anyone attempting to answer this "question" is asking to be incorrect.

;o)

(or


nothing is foolproof to the sufficiently talented fool..

Share this post


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

Share this post


Link to post
Share on other sites

On the Topic of KISS, couldn't you just do this

$hour=21
$min=30
$sec=0
Do
    Sleep(1000)
Until @hour=$HOUR And @min=$MIN And @sec=$SEC ; like to put the changing one b4 "=" 

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

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