Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

task scheduler tâches

47 views
Skip to first unread message

j4e8a16n

unread,
Jan 31, 2013, 6:59:26 AM1/31/13
to
Hi

Thiscode works nicely:
@echo
call z-last-DATE.cmd
set /A _ww=%date%
set /A _xx=%_ww% - %_dd%
@echo %_xx%
set /A _DD=%_xx%*-1
set /A _D=%_DD%+1
@echo .
@echo .
@echo %_D%


except if I call the cmd file from the task scheduler. In wich case I have a prompt about missing parameters. I think the cmd extension are not on with the task scheduler. Maybe that is the problem.

Thanks for your attention.

JP

billious

unread,
Jan 31, 2013, 10:21:30 AM1/31/13
to
Sadly, you don't show us what z-last-date.cmd contains, nor do you
reveal what the "prompt" you're receiving actually says.

Looking into the crystal ball, I'd suggest that you're trying to set an
environment variable called "DATE" within z-last-date.

%DATE% is a magic variable, containing the current short-date-string
which depends on your locale. It's likely to contain something like
Thu 01-31-2013.

SET /A won't like trying to set _WW to such a string and is likely to
generate a "Missing Operator" message.

Naturally, the user under which the scheduled job is executed will
determine the date-format used (it's set on a USER basis) and hence YOU
may be executing the job with one format and the Task scheduler with a
different format.

set /? will give you a listing of the magic variables.

SETLOCAL ENABLECOMMANDEXTENSIONS
SETLOCAL DISABLECOMMANDEXTENSIONS

should enable/disable the command-extensions if that is the problem.

set /? will reveal that %DATE% is only filled out automatically if
command extensions are ENABLED.

and you're more likely to get responses and info from alt.msdos.batch.nt
- yours in only the second post in THIS group in the past 2 months...

j4e8a16n

unread,
Jan 31, 2013, 3:28:58 PM1/31/13
to
Thank you in z-later there was : set /A _dd=2013-01-26
0 new messages