How to only copy NEW files to a folder using a batch file (syncing) - (Batch Files #6). How to only copy NEW files to a folder syncing (Batch files part 6)
xcopy "C:\Users\How2win7\Desktop\Podcast downloads" "F:\Podcasts" /d
Follow me on other media:
Marathon Man (audionautix.com)
In this example I'm going to demonstrate this with the scenario of moving newly downloaded podcasts to an mp3-player.
If you do this for multiple folders, this batch file will save you a lot of time compared to manually copying.
In my folder 'Podcast downloads' I have all 8 episodes of a podcast I'm following.
On my mp3-player however, I only have the 5 first episodes.
First, create a .txt in your source folder:
Right-click in the folder → New → Text Document
Name your text document and open it.
Type "Xcopy", which is a copy command, ...
Followed by the source folder filepath, (which you can copy from the folder's window address bar)...
I only want to copy mp3 files, so I add: "\*.mp3", which means that the command is only valid for files that end with ".mp3" in this folder.
Remember to start and end filepaths with quotation marks (").
Type a space, and then type the destination filepath.
end the command line by typing the switch "/d".
This will make sure the batch file will only copy source files that are newer than the files in the destination folder.
Save the text document and close it.
Rename the file extension of the text document to '.bat' to make it into a batch file.
Double-click the batch file to execute it.
It works! You can now see that your files are being copied in the command window.
Done, all files are copied!
Tags: How to only copy NEW files to a folder using a batch file (syncing) - (Batch Files #6), Batch File (File Format), copy, Computer File, xcopy, folder, syncing, synchronizing, command, cmd, Windows, Microsoft Windows (Operating System), Windows 7 (Operating System), Windows 8 (Operating System), Batch Processing, filepath, Only, Tutorial, how2win7, source, destination, text document, file, Podcast (Website Category), how-to, tips, tricks, backup, my documents