General discussion

Locked

DOS copy

By Ern calders ·
I'm trying to write a simple script that copies files from one pc to another on startup. So far I've done this by making a batchfile that uses the DOS copy-command. But to make the proces as short as possible I'ld like to know if it is possible to only copy the files that have been altered since the last time they were copied. Is there some kind of switch available that does this in the DOS copy-command? or is there an other (more modern way) to do it?

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by p.j.hutchison In reply to DOS copy

You need to use the DOS XCOPY command which has more features than plain DOS. Use the /M (copy with arch flag set).
There are alternative copy command such as XXCopy, Zcopy and robocopy which may be better.

Collapse -

by wlbowers In reply to DOS copy

Use the xcopy command.

xcopy c:\save\*.* e:\save\*.* /D /Y /V

The above command will copy files from c:\save to E:\save.

the /D switch specifies only files uhose source time is newer than the destination time.

The /Y switch keeps you from answering the overwrite prompt.

The /V switch will verify files after copy.

For a complete listing of xcopy or copy commands open a dos window and type

xcopy /? and press enter
copy /? and press enter

Good Luck Lee

Back to Desktop Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums