Re: Batch File Problem
- From: "Pegasus \(MVP\)" <I.can@xxxxxxx>
- Date: Thu, 1 Sep 2005 13:14:37 +1000
"Bob Felton" <bob123.removethis@xxxxxxxxxxxxx> wrote in message
news:g7rch1h9jd6tmf1nd3sv43v7ahvv655vac@xxxxxxxxxx
> Have two Windows XP Pro SP2 computers on a workgroup LAN: comp1 and
> comp2. Simple networking has been turned off on both. I have a
> folder on comp2 shared and a drive letter on comp1 mapped to it. User
> access rights were set via Security and tested using Windows Explorer.
> In the Windows GUI I can copy files from comp1 to the mapped drive
> using Windows Explorer without problem. I create a batch file to
> xcopy the same file and when run from the GUI (double clicking) or
> from a cmd prompt, it fails. Filenames appear but have 0 bytes.
> "Access denied" is returned when trying from the cmd prompt .
> However, if i manually copy the file from within the cmd prompt by
> simply typing the command it works! I note now, however, that the
> batch file is using xcopy and the manual copy used copy. I failed to
> test manually using xcopy. Can anyone point me to the problem and how
> to solve? Is it as simple as using copy vs xcopy? Tnx es 73!
> --
> Bob Felton
There is no difference between running a command from the
Command Prompt or running it inside a batch file. Your
problem is caused by something else that is not apparent
from your post. To find out what it is, run these simple tests:
1. From a Command Prompt, type the copy command that
works, e.g.
copy "c:\Some Folder\Some Subfolder\Some File.doc" x:\Docs
2. Now type type command from the Command Prompt:
echo copy "c:\Some Folder\Some Subfolder\Some File.doc" x:\Docs >
c:\test.bat
(this is one long line!).
3. Now type this from the Command Prompt:
c:\test.bat
I bet that it works! Conversely, do the same thing with your
original failing batch files: Retype its xcopy.exe command verbatim
on the Command Line. It will fail too!
If you still have a problem, post ***all commands*** and
***all batch files*** verbatim. Someone will tell you what's
wrong. It is highly unlikely that it is copy vs. xcopy.
.
- Follow-Ups:
- Re: Batch File Problem
- From: Bob Felton
- Re: Batch File Problem
- References:
- Batch File Problem
- From: Bob Felton
- Batch File Problem
- Prev by Date: Re: Taskbar Icons not showing
- Next by Date: Re: Huge Problem!!
- Previous by thread: Batch File Problem
- Next by thread: Re: Batch File Problem
- Index(es):
Relevant Pages
|