task scheduler troubleshooting

M

Mike Beste

*Technet Plus consumer* priority response requested

I am having a problem using the Windows 2000 Task
Scheduler, specifically ...getting a simple bat file to
work. Here is the detail:

The bat file (c:\bat\test.bat) has the following lines in
it:
__________________________
c:
cd\bkf.it-gst75
xcopy /f *.bkf j:
__________________________

It basically copies *.bkf files from a directory
called 'bkf.it-gst75' to a remote storage location that
has been mapped logically to 'j:'.

It works great when you either double click on the file or
run it from a command prompt. I have scheduled a task
using the domain administrator's account (and logged in as
the domain admin). From the GUI it appears that the task
completed successfully but the data never gets copied to
j:\. The log detail suggests the same. I pasted the last
couple lines below:
_________________________________
"test.job" (test.bat)
Started 10/30/2003 8:24:20 PM
"test.job" (test.bat)
Finished 10/30/2003 8:24:20 PM
Result: The task completed with an exit code of
(4).
[ ***** Most recent entry is above this line ***** ]
_________________________________
The task properties the parameters are:

Run: C:\BAT\test.bat
Start in: C:\BAT
Run as: DOMAIN\administrator

I even added 'Domain Admins" to the security tab with full
control.
____________________________________
I have tried to use at.exe as well using the following
syntax for example:
C:\BAT>at.exe 20:44 /every:m,t,w,th,f,s,su c:\bat\test.bat
Added a new job with job ID = 1
____________________________________
log detail for this is pasted below:
"At1.job" (test.bat)
Started 10/30/2003 8:44:00 PM
"At1.job" (test.bat)
Finished 10/30/2003 8:44:00 PM
Result: The task completed with an exit code of
(4).
[ ***** Most recent entry is above this line ***** ]
________________________________

Still the data never makes it to j:\.

What the heck is going on?

Thanks,

Mike
 
P

Pegasus \(MVP\)

You're assuming that there is a %path% defined in the
process that runs your scheduled job. This is probably
not correct, hence xcopy.exe won't work. If you include
this line

echo Path=%path% > c:\mike.txt

then you will soon see what's going on.

You're also assuming that drive J: is accessible to the
backup job. This depends entirely on the account you
use for the scheduled job. To find out, do this:

%SystemRoot%\system32\xcopy /f *.bkf j: 1>>c:\mike.txt 2>c:\mike.err
 
P

Phil Robyn

Mike said:
*Technet Plus consumer* priority response requested

I am having a problem using the Windows 2000 Task
Scheduler, specifically ...getting a simple bat file to
work. Here is the detail:

The bat file (c:\bat\test.bat) has the following lines in
it:
__________________________
c:
cd\bkf.it-gst75
xcopy /f *.bkf j:
__________________________

It basically copies *.bkf files from a directory
called 'bkf.it-gst75' to a remote storage location that
has been mapped logically to 'j:'.

It works great when you either double click on the file or
run it from a command prompt. I have scheduled a task
using the domain administrator's account (and logged in as
the domain admin). From the GUI it appears that the task
completed successfully but the data never gets copied to
j:\. The log detail suggests the same. I pasted the last
couple lines below:
_________________________________
"test.job" (test.bat)
Started 10/30/2003 8:24:20 PM
"test.job" (test.bat)
Finished 10/30/2003 8:24:20 PM
Result: The task completed with an exit code of
(4).
[ ***** Most recent entry is above this line ***** ]
_________________________________
The task properties the parameters are:

Run: C:\BAT\test.bat
Start in: C:\BAT
Run as: DOMAIN\administrator

I even added 'Domain Admins" to the security tab with full
control.
____________________________________
I have tried to use at.exe as well using the following
syntax for example:
C:\BAT>at.exe 20:44 /every:m,t,w,th,f,s,su c:\bat\test.bat
Added a new job with job ID = 1
____________________________________
log detail for this is pasted below:
"At1.job" (test.bat)
Started 10/30/2003 8:44:00 PM
"At1.job" (test.bat)
Finished 10/30/2003 8:44:00 PM
Result: The task completed with an exit code of
(4).
[ ***** Most recent entry is above this line ***** ]
________________________________

Still the data never makes it to j:\.

What the heck is going on?

Thanks,

Mike

The easiest solution is to add a 'net use' command at the
beginning of the scheduled batch file to establish a drive
mapping.
 
G

Guest

I added the path and it started working like a nice set of
tits.

Much appreciated,

Mike

-----Original Message-----
You're assuming that there is a %path% defined in the
process that runs your scheduled job. This is probably
not correct, hence xcopy.exe won't work. If you include
this line

echo Path=%path% > c:\mike.txt

then you will soon see what's going on.

You're also assuming that drive J: is accessible to the
backup job. This depends entirely on the account you
use for the scheduled job. To find out, do this:

%SystemRoot%\system32\xcopy /f *.bkf j: 1>>c:\mike.txt 2>c:\mike.err


Mike Beste said:
*Technet Plus consumer* priority response requested

I am having a problem using the Windows 2000 Task
Scheduler, specifically ...getting a simple bat file to
work. Here is the detail:

The bat file (c:\bat\test.bat) has the following lines in
it:
__________________________
c:
cd\bkf.it-gst75
xcopy /f *.bkf j:
__________________________

It basically copies *.bkf files from a directory
called 'bkf.it-gst75' to a remote storage location that
has been mapped logically to 'j:'.

It works great when you either double click on the file or
run it from a command prompt. I have scheduled a task
using the domain administrator's account (and logged in as
the domain admin). From the GUI it appears that the task
completed successfully but the data never gets copied to
j:\. The log detail suggests the same. I pasted the last
couple lines below:
_________________________________
"test.job" (test.bat)
Started 10/30/2003 8:24:20 PM
"test.job" (test.bat)
Finished 10/30/2003 8:24:20 PM
Result: The task completed with an exit code of
(4).
[ ***** Most recent entry is above this line ***** ]
_________________________________
The task properties the parameters are:

Run: C:\BAT\test.bat
Start in: C:\BAT
Run as: DOMAIN\administrator

I even added 'Domain Admins" to the security tab with full
control.
____________________________________
I have tried to use at.exe as well using the following
syntax for example:
C:\BAT>at.exe 20:44 /every:m,t,w,th,f,s,su c:\bat\test.bat
Added a new job with job ID = 1
____________________________________
log detail for this is pasted below:
"At1.job" (test.bat)
Started 10/30/2003 8:44:00 PM
"At1.job" (test.bat)
Finished 10/30/2003 8:44:00 PM
Result: The task completed with an exit code of
(4).
[ ***** Most recent entry is above this line ***** ]
________________________________

Still the data never makes it to j:\.

What the heck is going on?

Thanks,

Mike


.
 
R

Ricardo M. Urbano - W2K/NT4 MVP

I added the path and it started working like a nice set of
tits.

Much appreciated,

Mike
-----Original Message-----
You're assuming that there is a %path% defined in the
process that runs your scheduled job. This is probably
not correct, hence xcopy.exe won't work. If you include
this line

echo Path=%path% > c:\mike.txt

then you will soon see what's going on.

You're also assuming that drive J: is accessible to the
backup job. This depends entirely on the account you
use for the scheduled job. To find out, do this:

%SystemRoot%\system32\xcopy /f *.bkf j: 1>>c:\mike.txt 2>c:\mike.err


Mike Beste said:
*Technet Plus consumer* priority response requested

I am having a problem using the Windows 2000 Task
Scheduler, specifically ...getting a simple bat file to
work. Here is the detail:

The bat file (c:\bat\test.bat) has the following lines in
it:
__________________________
c:
cd\bkf.it-gst75
xcopy /f *.bkf j:
__________________________

It basically copies *.bkf files from a directory
called 'bkf.it-gst75' to a remote storage location that
has been mapped logically to 'j:'.

It works great when you either double click on the file or
run it from a command prompt. I have scheduled a task
using the domain administrator's account (and logged in as
the domain admin). From the GUI it appears that the task
completed successfully but the data never gets copied to
j:\. The log detail suggests the same. I pasted the last
couple lines below:
_________________________________
"test.job" (test.bat)
Started 10/30/2003 8:24:20 PM
"test.job" (test.bat)
Finished 10/30/2003 8:24:20 PM
Result: The task completed with an exit code of
(4).
[ ***** Most recent entry is above this line ***** ]
_________________________________
The task properties the parameters are:

Run: C:\BAT\test.bat
Start in: C:\BAT
Run as: DOMAIN\administrator

I even added 'Domain Admins" to the security tab with full
control.
____________________________________
I have tried to use at.exe as well using the following
syntax for example:
C:\BAT>at.exe 20:44 /every:m,t,w,th,f,s,su c:\bat\test.bat
Added a new job with job ID = 1
____________________________________
log detail for this is pasted below:
"At1.job" (test.bat)
Started 10/30/2003 8:44:00 PM
"At1.job" (test.bat)
Finished 10/30/2003 8:44:00 PM
Result: The task completed with an exit code of
(4).
[ ***** Most recent entry is above this line ***** ]
________________________________

Still the data never makes it to j:\.

What the heck is going on?

Thanks,

Mike


.

Not very PC, but funny as hell!
 

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