AT to create HOURLY task?

M

Mandy

Is it possible to create a task which will run on an hourly basis? I would hate to create 24 tasks.

In order to get close without using 24, I currently use:
AT 07:00 /every:M,T,W,Th,F,S,Su "doThis\rightHere.vbs"
AT 08:00 /every:M,T,W,Th,F,S,Su "doThis\rightHere.vbs"
AT 11:00 /every:M,T,W,Th,F,S,Su "doThis\rightHere.vbs"
AT 12:00 /every:M,T,W,Th,F,S,Su "doThis\rightHere.vbs"
AT 16:00 /every:M,T,W,Th,F,S,Su "doThis\rightHere.vbs"
AT 16:45 /every:M,T,W,Th,F,S,Su "doThis\rightHere.vbs"
AT 23:00 /every:M,T,W,Th,F,S,Su "doThis\rightHere.vbs"

I need to use a non-wizard means to create this task, as it's to be done via script.

It would also be helpful to have a simple (and scriptable) way to delete the task as needed, without knowing the task ID.

Thank you in advance.
 
J

jack tinker

You could use schtasks /create (if you had windows server 2003)

Perhaps you could write a batch file to wait and run that instead - or
incorporate the Wait in your VBS
 
J

jack tinker

You could also create the task in task scheduler wizard with your desired
schedule, then copy the .job file (c:\winnt\tasks\yourtask.job) into the
corresponding folder on your target PC.
 
K

-- Ken --

Are you ina Win2k or WinXP environment? If it is a WinXP environment I
would suggest using the SCHTASKS utility rather than AT. It provides you
with exactly what you are asking for and can even be used to create
scheduled tasks on remote systems.

-Ken-
 
M

Matthias Tacke

Mandy said:
Is it possible to create a task which will run on an hourly
basis? I would hate to create 24 tasks.

In order to get close without using 24, I currently use:
AT 07:00 /every:M,T,W,Th,F,S,Su "doThis\rightHere.vbs"
AT 08:00 /every:M,T,W,Th,F,S,Su "doThis\rightHere.vbs"
AT 11:00 /every:M,T,W,Th,F,S,Su "doThis\rightHere.vbs"
AT 12:00 /every:M,T,W,Th,F,S,Su "doThis\rightHere.vbs"
AT 16:00 /every:M,T,W,Th,F,S,Su "doThis\rightHere.vbs"
AT 16:45 /every:M,T,W,Th,F,S,Su "doThis\rightHere.vbs"
AT 23:00 /every:M,T,W,Th,F,S,Su "doThis\rightHere.vbs"

I need to use a non-wizard means to create this task, as it's
to be done via script.

I like the free att.exe from Frank P. Westlkae for such purposes.
http://gearbox.maem.umr.edu/fwu/
Att.exe schedules itself to generate the next interval.
It would also be helpful to have a simple (and scriptable) way to
delete the task as needed, without knowing the task ID.
You will have to identify the job somehow. At (or ATT) without
arguments list current jobs, use find/findstr to filter by
name/program and parse this output with a for loop.

Provided you sched. your above script with
ATT +1m /r:h cscript /NOLOGO "doThis\rightHere.vbs"

You may delete the schedule at the command line with
for /f "tokens=5" %A in ('att^|find "doThis\rightHere.vbs"') do @att /d %A

or from a batch
@echo off
for /f "tokens=5" %%A in (
'att^|find "doThis\rightHere.vbs"'
) do @att /d %A

HTH
 

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