View Full Version : Scheduling a random task
Brunzwick
12-08-2004, 04:54 PM
I'm trying to find a way to run a file on a random day after the user enters the CD to remind them to complete a form. I have a simple batch file that I can run from an at job that will create a pop-up message similar to using Dialog.Message, but I don't want everyone in the company submitting their forms all at once. What I cant seem to figure out is how to add a random number of days to System.GetDate and then use that date to create the at statement in a text file, then rename the text file as a .bat and run it. Ideally, I would like to limit the reminder to a minimum of 15 days and a maximum of 60.
Anyone have any ideas???
Maybe you could adapt this to do what need.
This generates a random number between 15 and 60, and then adds it to todays date using a couple functions that convert the current date to Julian, then adds the days, then converts back to Gregorian.
TJ_Tigger
12-08-2004, 10:32 PM
Maybe you could adapt this to do what need.
This generates a random number between 15 and 60, and then adds it to todays date using a couple functions that convert the current date to Julian, then adds the days, then converts back to Gregorian.
Worm, You amaze me sometimes. The formulas you come up with are too cool.
Oh how I wish it were true Tig.
I guess the best you could be is impressed with my Google Searching Skills :yes
http://aa.usno.navy.mil/faq/docs/JD_Formula.html
Corey
12-09-2004, 07:14 AM
Don't knock it, Google's advanced search features have been my primary secret weapon for years. :)
TJ_Tigger
12-09-2004, 09:04 AM
Hopefully I didn't demystify your expertise. Maybe we can delete the post before everyone reads it and figures out yours and Coreys secret weapon.
Ok he is still in the bag
http://picture.funnyjunk.com/pics/cat_in_a_bag.jpg
Tigg
Corey
12-09-2004, 09:08 AM
*That* kind of thinking will get you places. Just don't forget us wee people, for we Googlers are a stout but loyal lot. :yes
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.