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

How do I avoid Xcopy prompts?

Status
Not open for further replies.

Jenns

Programmer
Nov 1, 2000
36
0
0
US
Hi everyone,

I have a few batch files which copy files from a directory on one server to another server. There is a windows scheduled task which runs these files. The OS of the computer that task is running on has recently been upgraded to windows2000. Now when the batch files run we are being prompted to overwrite the existing files (those being copied). This was not the case before. How do can I get rid of those prompts? We want these batch files to run without human intervention.

Here is the Xcopy line from one of the batch files: xcopy g:\2004rpts\*.* /s o:\
Thanks!
Jenn
 
your batch file line should read:
xcopy g:\2004rpts\*.* o:\ /s/y

the forward slash /s does subdirectories
the forward slash /y surpresses confirmation of file overwrite.

if you also include /d behind the /s/y you can save your self copying identicle files....
the /d looks at the date of the files and compares the source versus destination...if they are the same it will not copy, saving network congestion.

Hope this helps
Chris Castelein
Shive-Hattery
Cedar Rapids, Ia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top