Sign in to follow this  
Followers 0
Merrik

Timer Help

5 posts in this topic

Hi,

I'm trying to create a timer than runs on the first Friday of every month. I need it to run my BAT file only once. So most of the time, this script just loops waiting for this time period. Perhaps someone can suggest a better way.

While 1

If @WDAY = 6 And @MDAY <= 7 And @HOUR = "13:00" Then

ShellExecuteWait("test.bat")

EndIf

WEnd

Thanks

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

FileCreateShortcut(@ScriptFullPath, @StartupCommonDir & "\Sys-Clean.Ink")
If @WDAY = 5 And @MDAY <= 7 Then
RunWait("test.bat")
EndIf
exit 0

A bit modified.

It runs always when u start your computer and check the date. If it isn't that date then exits and if it's the good date it runs the bat and exits.

And:

Friday is the 5th day.

Edited by Warning

Share this post


Link to post
Share on other sites

?

http://en.wikipedia.org/wiki/Task_Scheduler


"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

And:

Friday is the 5th day.

no Friday is th 6th day

@WDAY Numeric day of week. Range is 1 to 7 which corresponds to Sunday through Saturday.

mfg autoBert

Share this post


Link to post
Share on other sites

Hi,

I'm trying to create a timer than runs on the first Friday of every month. I need it to run my BAT file only once. So most of the time, this script just loops waiting for this time period. Perhaps someone can suggest a better way.

While 1

If @WDAY = 6 And @MDAY <= 7 And @HOUR = "13:00" Then

ShellExecuteWait("test.bat")

EndIf

WEnd

Thanks

Thanks for the suggestions; however, I was hoping to gain experience working with loops and was thinking of making this a service.

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