batch file syntax

C

C.M.G.

The following batch file copies files from one directory to another, on the
same HD:

copy "C:\folder1\*.*" "C:\folder2"

My question is: what is the proper syntax to send the files to a directory
on a different computer that is networked with the source computer?

Thanks for your help.

Clem.
 
C

C.M.G.

Doug,

That works great, thanks a lot.

Is there an expression that would also copy all the folders, and not just
the files, contained within the source folder?

Thanks again,

Clem.

Copy "C:\folder1\*.*" "\\<computername>\<sharename>\<foldername>"
 
K

Ken Blake

C.M.G. said:
The following batch file copies files from one directory to another,
on the same HD:

copy "C:\folder1\*.*" "C:\folder2"

My question is: what is the proper syntax to send the files to a
directory on a different computer that is networked with the source
computer?


In addition to Doug's answer, if you map the network drive to a drive
letter, you can move files back and forth between the two computers, using
"DOS" commands or Windows Explorer, just as if the other computer's drive
was local.
 
D

Doug Knox MS-MVP

Use XCOPY instead of COPY. XCOPY /? will give you all the command line options.
 
C

C.M.G.

Ken,

Thanks for your response. How do I map the network drive to a drive letter?

Clem.
 
C

C.M.G.

Doug,

That takes care of it. Thanks!

Clem.

Use XCOPY instead of COPY. XCOPY /? will give you all the command line
options.

--
Doug Knox, MS-MVP Windows Media Center\Windows Powered Smart
Display\Security
Win 95/98/Me/XP Tweaks and Fixes
http://www.dougknox.com
 
B

Bruce Chambers

C.M.G. said:
Ken,

Thanks for your response. How do I map the network drive to a drive letter?

NET USE K: (drive letter of choice) \\SERVERNAME\SHARENAME

--

Bruce Chambers

Help us help you:



They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety. -Benjamin Franklin

Many people would rather die than think; in fact, most do. -Bertrum Russell
 

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