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

Using the command XCOPY and flags to copy files in XP-Pro?

Status
Not open for further replies.

stla

IS-IT--Management
Mar 12, 2003
190
DE
Good day,

My goal is to the copy the contents of one folder to another folder and to overwrite any existing files that might be in there with the same name without being prompted.

My source directory has several sub directories and I would like to repeat this in the target location ie. the trees should be the same

I have written a small script and will attach it to a scheduled task (the OS is WIN-XP):

XCOPY C:\DATA\* D:\TEST\ /E /Y

Are my flags correct in this case?

Best regards

 
Hi, Stia

That should do it, hwvr depending on the situation you might want to add:

/K To keep file attributes (read only)
/H To also include hidden and system files
/R To allow overwriting read only files
/O To also copy file ownership info
/C To continue copying despite errors (such as file in use)

For a complete list: XCOPY /? at a command prompt.

Jock
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top