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

XCOPY and Task Scheduler

3,267 views
Skip to first unread message

gil dering

unread,
Jun 20, 2002, 2:17:20 PM6/20/02
to
I need to move directories & files from a shared drive to
a local drive using the task scheduler. I can run my
batch file (XCOPY SOURCE TO DESTINATION) and accomplish
the copy task if I run the batch from the System32
directory. However, when I try to run the same batch file
from the Task Scheduler it fails with "0X4" ("Cannot open
file") error . . .!!??
Any Help?

Michael Bednarek

unread,
Jun 20, 2002, 9:49:40 PM6/20/02
to
Can you run XCOPY when you are not in system32 ?

Inspect the output of
SET PATH
and compare it to the registry value for
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
or, alternatively, with the content of: Control Panel / System /
Advanced / Environment Variables... / System variables / Path

Why do you use a batch file? Couldn't you just enter the command:
XCOPY source destination
into the scheduled task's "Run:" box?

Please post the exact content of the scheduled task's "Run:" and
"Start in:" boxes.

Please post the batch file here.
Are you sure the source file exists? Is it a fully qualified name?
Are you logged in when the scheduled job runs? If you are not, note
that access to network drives for scheduled jobs is problematic.

Good luck.

On Thu, 20 Jun 2002 11:17:20 -0700, "gil dering"
<gil.d...@sbs.siemens.com> wrote in
microsoft.public.win2000.cmdprompt.admin:

--
Michael Bednarek, IT Manager, Tactical Global Management
Waterfront Pl, Brisbane 4000, Australia. "POST NO BILLS"
http://mcmbednarek.tripod.com/

gil dering

unread,
Jun 21, 2002, 10:05:35 AM6/21/02
to
Thanks for the reply . . . Answers below . . .

Yes, I can run XCOPY from directories other than System32.

I am not sure what to look for in the reference you made
to the registry . . . ??

I am using the Task Scheduler and I do not see "RUN"
OR "STARTIN" boxes. That is the reason for the ".bat"
files.

The batch file is . . .

***************
XCOPY g:\KANA\data\solutionline\knowledgebases\brain2000
d:\kana\data\solutionline\knolwedgebases\brain2000
exit
*******************
The file definately exits and is correct as I can run
the ".bat" from System32 but cannot run it when signed on
the server from the Task Scheduler.

>.
>

Michael Bednarek

unread,
Jun 22, 2002, 7:34:03 AM6/22/02
to
On Fri, 21 Jun 2002 07:05:35 -0700, "gil dering"
<gil.d...@sbs.siemens.com> wrote in
microsoft.public.win2000.cmdprompt.admin:

>Thanks for the reply . . . Answers below . . .


>
>Yes, I can run XCOPY from directories other than System32.
>
>I am not sure what to look for in the reference you made
>to the registry . . . ??

I was trying to find out whether your PATH environment variable
included system32 so that the scheduled job will find XCOPY.EXE .

>I am using the Task Scheduler and I do not see "RUN"
>OR "STARTIN" boxes. That is the reason for the ".bat"
>files.

I was referring to the properties of the scheduled task, as available
by right-clicking its entry in the Task Scheduler. They have a "Run:"
and "Start in:" box on my systems (Win4, NT5.0).

>The batch file is . . .
>
>***************
>XCOPY g:\KANA\data\solutionline\knowledgebases\brain2000
>d:\kana\data\solutionline\knolwedgebases\brain2000
>exit
>*******************
>The file definately exits and is correct as I can run
>the ".bat" from System32 but cannot run it when signed on
>the server from the Task Scheduler.

Are d: and g: local or network drives?
Are you logged at the time when the scheduled jobs are to be run?

--
Michael Bednarek, IT Manager, TGM Ltd, Brisbane, Australia
http://mcmbednarek.tripod.com/ "POST NO BILLS"

ZS

unread,
Jun 24, 2002, 10:02:19 AM6/24/02
to
Whats the diff betweeen running a batch file from the
desktop as opposed to invoking it from Task Sceduler [&
not being logged in, ie unattended backups]?

I have a bu batch file which works fine in either case..
however when Task Scheduler invokes the bu file, a CALL
from within [to copy & delete old log files], will not
execute.
This also has me stumped. Can't see any errors thrown
anywhere.
ZS

>.
>

Alan Crowe

unread,
Jun 24, 2002, 11:02:22 AM6/24/02
to
Hmmm... We use robocopy to do this kind of stuff.

If you can run the batch file when logged in
interactively, it might be a permissions thing...

Scheduled tasks run in the system context (unless you've
set up a specific account for the scheduler to run as), so
ensure that SYSTEM has access to what you're trying to
copy...

HTH

Alan Crowe MCSE
NT Systems Manager
Shell Information Technology International Ltd.
St. Magnus House, Guild Street
Aberdeen. AB11 6NJ.

>.
>

Jonathan de Boyne Pollard

unread,
Jul 17, 2002, 7:39:44 PM7/17/02
to
gd> I need to move directories & files from a shared drive to
gd> a local drive using the task scheduler.

Ensure that the scheduled process is run as a domain user, not as the
local system account. The local system account has no network access
rights.

0 new messages