Re: Batch File Problem




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


.



Relevant Pages

  • Release : ComLog 1.0, a WIN32 command prompt logger
    ... a WIN32 command prompt logger ... DOS sessions on Windows NT/2K (should also work on XP, ... This tool can be used by administrator to keep a history of commands ... typed in the DOS command prompt and the associated output, ...
    (Focus-IDS)
  • [Full-Disclosure] Release : ComLog 1.0, a WIN32 command prompt logger
    ... a WIN32 command prompt logger ... DOS sessions on Windows NT/2K (should also work on XP, ... This tool can be used by administrator to keep a history of commands ... typed in the DOS command prompt and the associated output, ...
    (Full-Disclosure)
  • Re: How To Execute Batch File Line By Line
    ... COMMAND /C string Carries out the command specified by string, ... CMD /C Carries out the command specified by string and then terminates. ... Both .cmd and .bat files work on Windows NT versions. ... File Description MS-DOS Batch File ...
    (microsoft.public.windowsxp.general)
  • Re: Great SWT Program
    ... Windows' default command line buffer is explained in detail here: ... For the purposes of a batch file, ... then put the files from the working directory back. ...
    (comp.lang.java.programmer)
  • RE: blues screen on loading windows XP
    ... the installation disk, insert it into your cd-rom and restart your computer, ... it will take you to another black screen with a command prompt. ... Boot your problem computer with this CD, open a Command Prompt window, ... but Windows did not start successfully. ...
    (microsoft.public.windowsxp.help_and_support)