I'm using this command to copy a file on a daily basis.

COPY "E:\ClipData.txt" "Clipboard\ClipData.txt"

But is there anyway without making it complicated, to copy the file after the source file has been modified?

There are standalon softwares that manages to do that, but the application must be running al the time.

So the cmd solution is much better.

  • Do you mean if there is a change or after there has been a change? Former is easy, latter needs the sw to be on all the time – Karthik T Nov 27 '12 at 1:19
  • After there has been a change. Whats I have are the line inside a .bat file, and using task schdule in Windows XP to repeat it every day. – Johan Larsson Nov 27 '12 at 1:25

If it is enough to check if the file has been changed before you copy it, replace copy with xcopy /D. It should now only copy the file if it has changed. If you put it in a batch file and run it every so often, it will only copy the file after it has changed

reference : http://www.computerhope.com/xcopyhlp.htm


There's the Archive bit that the system sets to 1 when the file has been changed. But to use it you'll need to remove this bit from all files at first, and then edit your script to remove this bit after coping a file.


There's robocopy: http://technet.microsoft.com/pt-br/library/cc733145(v=ws.10).aspx


To mirror the directory "C:\directory" to "\server2\directory" excluding \server2\directory\dir2" from being deleted (since it isn't present in C:\directory) use the following command:

Robocopy "C:\Folder" "\Machine2\Folder" /MIR /XD \server2\ directory\dir2"

Robocopy can be setup as a simply Scheduled Task that runs daily, hourly, weekly etc. Note that Robocopy also contains a switch that will make Robocopy monitor the source for changes and invoke synchronization each time a configurable number of changes has been made. This may work in your scenario, but be aware that Robocopy will not just copy the changes, it will scan the complete directory structure just like a normal mirroring procedure. If there are a lot of files & directories, this may hamper performance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.