Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with copy command (syntax)

Status
Not open for further replies.

cbflip2003

IS-IT--Management
May 8, 2005
20
GB
Hi everyone,
I am trying to make a syntax that will run a big job but there is one little problem. I want to copy the folder but it copies the content and directory within the folder but not the folder it self. This syntax below is a simple version of what I want.

XCOPY "c:\new folder" "C:\Documents and Settings\chris\Desktop" /e

Basically copy and past
It has to be a simple problem that I don’t see!
 
Xcopy should do what you want. Copy is designed for copying files, Xcopy is designed for copying files and directories.

xcopy /?


Carlsberg don't run I.T departments, but if they did they'd probably be more fun.
 
Try

XCOPY "c:\new folder" "C:\Documents and Settings\chris\Desktop\new folder" /e /i
 
Here is what I would use:

XCOPY "c:\new folder" "C:\Documents and Settings\chris\Desktop\new folder" /s /e /v

Ed
 
Wow. This should be a no-brainer:

/i : If Source is a directory or contains wildcards and Destination does not exist, xcopy assumes destination specifies a directory name and creates a new directory. Then, xcopy copies all specified files into the new directory. By default, xcopy prompts you to specify whether Destination is a file or a directory.

/s : Copies directories and subdirectories, unless they are empty. If you omit /s, xcopy works within a single directory.

/e : Copies all subdirectories, even if they are empty. Use /e with the /s and /t command-line options.

/t : Copies the subdirectory structure (that is, the tree) only, not files. To copy empty directories, you must include the /e command-line option.





____________________________
Users Helping Users
 
Thanks for the replays!
guitarzan You are on the ball!! Of course.. I did not put \new folder at the end I said it was easy. If you look too hard you miss the simple bit. Thanks bcastner for the refresh.

regards,
Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top