Re: Batch File Problem



Thanks for the quick response. I admit I was surprised when the
manual test worked. I will be back at the client on Friday and will
be able to do the tests you suggest. I will advise results. Thanks,
again.


On Thu, 1 Sep 2005 13:14:37 +1000, "Pegasus \(MVP\)" <I.can@xxxxxxx>
wrote:

>
>"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.
>

--
Bob Felton
.



Relevant Pages

  • Re: How to copy whole folders?
    ... First of all your syntax is different than xcopy help shows: ... I want just to move my batch file from one folder to another and run it ... error and restart the same xcopy command until all files are copied. ...
    (microsoft.public.windows.file_system)
  • Re: How do I launch MS-DOS prompt to execute a batch file from within Excel worksheet with /VBA?
    ... You've asked for a command prompt from VBA. ... that in order to run your batch file. ...
    (microsoft.public.excel)
  • Re: Mass copy of files: how to?
    ... Avoiding "command lines" means that you have to perform the ... suggest a reliable batch file solution based on robocopy.exe. ... (which would be nice when using the Task Scheduler). ... A VERY brief tutorial on how to do this - use a batch file where you redirect the output to log files - for example, even using xcopy right now, you can simply append "output.log 2>&1" and "see" all that you would see if you run the command manually. ...
    (microsoft.public.windows.server.general)
  • Re: Sophisticated(!) copying in DOS
    ... 'xcopy' is not recognized as an internal or external command, ... here is the full command in my batch file: ... > Specifies a list of files containing strings. ...
    (microsoft.public.windowsxp.general)
  • Re: Batch File Problem
    ... > access rights were set via Security and tested using Windows Explorer. ... > batch file is using xcopy and the manual copy used copy. ... There is no difference between running a command from the ... Command Prompt or running it inside a batch file. ...
    (microsoft.public.windowsxp.general)