Need a copy script

  • Thread starter Thread starter Print Guy
  • Start date Start date
P

Print Guy

I need to be able to run a dos batch job which will copy the contents
of one directory to another without prompting me for overwritting. I
want this is a DOS batch job so that I can make it a schedulled task
under XP. This will give me the ability to copy the contents of a
project folder from my working machine to the machine where I store it.
Would anyone have something like this lying around that they are
willing to share?
 
To suppress the overwrite prompt use the SET command and the COPYCMD
environment variable before the copy command in your batch file.

SET COPYCMD=/Y

Or use the /y switch in the command syntax. You can use copy or xcopy
to copy the files. Use the /? switch for help on the commeands, ie:

copy /?

xcopy /?

Search here:
http://www.robvanderwoude.com/index.html
http://www.ss64.com/nt/

John

Ps. If lots of files to copy robocopy might be better.
 
Print said:
I need to be able to run a dos batch job which will copy the contents
of one directory to another without prompting me for overwritting. I
want this is a DOS batch job so that I can make it a schedulled task
under XP. This will give me the ability to copy the contents of a
project folder from my working machine to the machine where I store
it. Would anyone have something like this lying around that they are
willing to share?

Take a look at the xcopy command. Look it up in Help and Support or open a
cmd prompt and type xcopy /?

something like this should work:

xcopy x:\source_path\*.* x:\destination_path /y

Personally I'd do some error checking and possibly delete the files in the
destination before copying.
 

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

Back
Top