using at command line to schedule tasks

R

Randy

I need to use the AT command line to submite a job as the
system account. Is there a way at the command line to
schedule a task to run on the first and third Tuesday of
every month? What would be the syntax?

thanks for the help.
Randy
 
D

Dave Patrick

at \\pcname 20:00 /every:m,t,w,th,f,sa,su "some command"

would run "some command" every day at 20:00 hours
Substitute the full quoted path for "some command"

at /?
for other syntax.

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect


:
|I need to use the AT command line to submite a job as the
| system account. Is there a way at the command line to
| schedule a task to run on the first and third Tuesday of
| every month? What would be the syntax?
|
| thanks for the help.
| Randy
 
P

Pegasus \(MVP\)

Randy said:
I need to use the AT command line to submite a job as the
system account. Is there a way at the command line to
schedule a task to run on the first and third Tuesday of
every month? What would be the syntax?

thanks for the help.
Randy

Use the syntax suggested by Dave Patrick to invoke the following
batch file ***every*** Thursday:

@echo off
SetLocal
for /F "tokens=2 delims=/ " %%d in ('echo %date%') do set dom=%%d
if %dom% LEQ 07 goto Action
if %dom% LEQ 14 goto :Eof
if %dom% LEQ 21 goto Action
goto :eof

:Action
YourCommand.exe
EndLocal

The batch file works for a %date% format of the following form:
Dow DD/MM/YYYY
If your date format is different then you must adjust the "token="
parameter accordingly.

I did not check the conditional statements exhaustively to ensure
that they fire your command every first and third Thursday each
month. You need to verify this yourself.
 
D

Dave Patrick

Nice one Pegasus

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect


:
|
| Use the syntax suggested by Dave Patrick to invoke the following
| batch file ***every*** Thursday:
|
| @echo off
| SetLocal
| for /F "tokens=2 delims=/ " %%d in ('echo %date%') do set dom=%%d
| if %dom% LEQ 07 goto Action
| if %dom% LEQ 14 goto :Eof
| if %dom% LEQ 21 goto Action
| goto :eof
|
| :Action
| YourCommand.exe
| EndLocal
|
| The batch file works for a %date% format of the following form:
| Dow DD/MM/YYYY
| If your date format is different then you must adjust the "token="
| parameter accordingly.
|
| I did not check the conditional statements exhaustively to ensure
| that they fire your command every first and third Thursday each
| month. You need to verify this yourself.
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top