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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy sub-directories using batch file or CMD commands

Status
Not open for further replies.

zudput

Technical User
Jul 3, 2003
16
0
0
US
How do I include sub directories when writing commands (.bat or .cmd) to copy from one directory(file) to another in Win XP? Thanks to all who have replied to my previous questions.
Dwight
 
Hello

Use xcopy sourcepath:sourcedirectoryname\filespec /s target

eg

xcopy "c:\documents and settings\*.*" /s f:\docs

/s will copy files and only subdirectories with files in.
/e will copy files and all subdirectories, regardless of whether there are files in them.

xcopy
 
Thank you, JRBarnett this is just what I need!!
Dwight
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top