Re: creating schtasks to run for a date range every month by R
R
Mon Jul 07 09:43:47 PDT 2008
On Jul 7, 12:29=A0pm, "Pegasus \(MVP\)" <I....@fly.com.oz> wrote:
> "R. Berger" <royb...@att.net> wrote in message
>
> news:e1053516-4d92-4f2d-9e58-3d95bc27c45f@y21g2000hsf.googlegroups.com...
>
>
>
>
>
> >I am attempting to use schtasks to create some scheduled tasks to run
> > on a monthly basis but am having trouble figuring out the right syntax
> > to get the desired behavior. =A0Basically, I want to run a batch file
> > every day (during the desired date range) starting at a specific
> > time. =A0Some examples:
>
> > =A0 =A0 =A0 =A0 I want a batch file to run every 23rd-30th of each mont=
h,
> > starting at 1:00am.
> > =A0 =A0 =A0 =A0 I want a batch file to run every 23rd-30th of each mont=
h,
> > starting at 10:00am.
>
> > =A0 =A0 =A0 =A0 I want a batch file to run every 15th-21st of each mont=
h,
> > starting at 1:00am.
> > =A0 =A0 =A0 =A0 I want a batch file to run every 15th-21st of each mont=
h,
> > starting at 10:00am.
>
> > The day-of-month range would be the same every month. =A0There doesn't
> > appear to be a way to specify more than one day, or a day range with
> > the /d parameter. =A0Is the only way to accomplish this to create a
> > separate scheduled task for each day of my desired range? =A0Thanks in
> > advance for any help.
>
> > Roy Berger
>
> You could use the Task Scheduler GUI to create tasks with multiple
> schedules. Alternatively you could schedule the task to run at 1am
> every day of the month and get it to invoke a batch file with some
> inbuilt intelligence:
> @echo off
> set DOM=3D%date:~7,2%
> if %DOM% LSS 23 goto :eof
> if %DOM% GTR 30 goto :eof
> {your command goes here}- Hide quoted text -
>
> - Show quoted text -
I'm trying to dumb this down for a non-admin user (regular user). The
GUI, while I can use it, is fairly intimidating for the casual user.
I can probably do something like you suggest. Was hoping for
something "built-in" to schtasks. I guess not. I have some
intelligence built into the software that my batch file runs, which
allows the process to retry N times per day, M minutes apart. I was
hoping to not have to write a scheduler. Again, maybe I can do
something like you suggest in a batch file hack.