Merrik Posted March 12, 2011 Posted March 12, 2011 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
Warning Posted March 12, 2011 Posted March 12, 2011 (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 March 12, 2011 by Warning
MvGulik Posted March 12, 2011 Posted March 12, 2011 ?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 ...
AutoBert Posted March 12, 2011 Posted March 12, 2011 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
Merrik Posted March 12, 2011 Author Posted March 12, 2011 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 WEndThanksThanks for the suggestions; however, I was hoping to gain experience working with loops and was thinking of making this a service.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now