DOS command to copy folder contents while excluding folders which already exist?

Associate
Joined
1 Aug 2003
Posts
833
I need to copy over some new music files to a raspberry pi which I have connected to my PC via wifi. The new files are in a big music folder along with lots of old ones. I thought I'd be able to do it via windows by selecting all the files and pasting them into the pi folder containing just the current old files. Then when windows asks if I want to overwrite the old files I'd select 'no' and click the checkbox to do this with all files etc. However, windows first checks to see if there's enough space on the destination drive for the whole paste procedure and there isn't, remember I just want to copy the latest files which would fit size wise.

Sooo, I thought I try doing this via dos. The best command I've found is robocopy with the /xx switch? Using this though kept throwing up an error with,
Invalid Parameter #3 : "z:\music" which is the destination folder. I can't work out why this doesn't work? I did have to use a command called 'pushd' initially to access the network mapped pi folder, which gave it the Z suffix but that worked fine and I can access the pi perfectly under the command prompt now. Here's the full command I'm using, robocopy d:\music collection z:\music *.* /xx

Sorry, this reads a bit long winded but hopefully someone can understand what I'm trying to achieve! I thought this would be simple!

Any advice much appreciated.
 
I use a windows tool called https://freefilesync.org/. I prefer the older versions. It transfers the differences one way if thats what you want. I always liked it over other tools and utilities.

I realise this isn't exactly what you want.

Another way is synching with Dropbox or such.
 
Assuming your copy+ paste is accurate, it's because there is a space in your origin folder path.

Enclose your paths in quotes (not needed for the second, but for good measure):

Code:
robocopy "d:\music collection" "z:\music" *.* /xx
 
I'm not sure the /xx switch is required with robocopy? I've never had it delete files with normal settings unless /purge is also used.

Not saying to use this but I use:

Code:
robocopy "%USERPROFILE%\Music" "U:\Music" /E /R:0 /W:1 /COPY:DT

on one of my setups.
 
I got to know Robocopy years ago from a colleague in I.T.

It didn't take me long to realize I hate creating batch files so I did a google search for a Robocopy GUI

and I found these There are these:

SyncToy
Gs Richcopy 360
Syncback

Some are free but the pay versions are reasonably priced.

SyncToy is free and does not use Robocopy but it is pretty decent and was developed by a man from Microsoft.

Gs Richcopy 360 and Syncback are fantastic and able to replace Robocopy , and are easy to use,full_featured, and can solve the issues that robocopy can't handle.
A quick Google search will yield results so I won't post any URLs here.

I am a GUI guy so I love these options.
 
Back
Top Bottom