Jump to content

Timer Help


Recommended Posts

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

Link to comment
Share on other sites

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

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

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...