Sign in to follow this  
Followers 0
ajdicky

Auto start every hour?

6 posts in this topic

I needa know how to make my script run every hour, could i make in run randomly once in every hour?

like it would only run once in a hour but different minutes as the last hour...

could i use anything inside the Date Management to do so?or do I have to use the sleep() command?

thanks:)

Share this post


Link to post
Share on other sites



I needa know how to make my script run every hour, could i make in run randomly once in every hour?

like it would only run once in a hour but different minutes as the last hour...

could i use anything inside the Date Management to do so?or do I have to use the sleep() command?

thanks:)

Use Windows Schedule Task.

Share this post


Link to post
Share on other sites

Use Windows Schedule Task.

>.< can't find it!help?

Share this post


Link to post
Share on other sites

$min=@MIN
$sec=@SEC
while $min="00" and $sec="00"
;your script here
wend


[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites

What do you mean you can't find it? What OS are you using? Start > All Programs > Accessories > System Tools > Scheduled tasks....

If you want to do it within your script though, something like this might work:

While 1
$Minute = Random(1,59,1)
    Do 
        Sleep(1000)
    Until @Min = $Minute
    
    ; do whatever
    
        ; Since we want it to run randomly once an hour, we need to calculate how much time is left before the hour is up, and sleep that length of time.
    $s = ((60 - $Minute) * 60) * 1000 
    Sleep($s)
WEnd

Share this post


Link to post
Share on other sites

hmm thx both of you :) i'll have to learn about it=\

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