views:

28

answers:

2

On Windows XP I'm trying to add a job like this:

at 17:07 /every:s dir

I expect dir to be executed every Saturday at 17:07, however I don't see anything happens in the command line window.

Here is the log:

D:\temp>at 17:07 /every:s dir
Added a new job with job ID = 1

D:\temp>time/t
05:06 PM

D:\temp>date/t
Sat 10/02/2010

D:\temp>at
Status ID   Day                     Time          Command Line
-------------------------------------------------------------------------------
Error   1   Each S                  5:07 PM       dir

D:\temp>time/t
05:08 PM

D:\temp>

What am I missing ?

A: 

I think you need to use the /interactive parameter in order for the output to be visible.

FixerMark
`/interactive` means that the command can interact with GUI windows even though services normally can not. It does not mean that output will get printed to an open console. See also [Applications Started with AT Are Not Interactive](http://support.microsoft.com/kb/121562).
Matthew Flaschen
Sorry, I meant to add that you need to explicitly launch md.exe as well :`cmd /c dir `. Microsoft have a suitable example here: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/at.mspx?mfr=true (btw, Other than writing a cutom application I don;t think there is any way to hook into an already open console window)
FixerMark
+1  A: 

The Task Scheduler service runs at commands in the background. You should not expect to see anything just because you happen to have a console open. A simple way to test that it runs is to write to a log file. You will likely want to wrap this in a batch file.

Matthew Flaschen