It all started with letting iTunes "organize" my video files. For some reason, it decided to create a subfolder for each of my files. Errrrrrr!
Now I'm looking for a way to copy the files in subdirectories back to a single directory. By some online searching and error-trial, here's my solution:
For /r %d "C:\source dir" in (*) do copy "%d" "E:\dest dir"
It's different than a suggested solution I found online something like:
For /r %d "C:\source dir" in (.) do copy %d\* "E:\dest dir"
However the period character doesn't work for me. According to the explaination, the (.) means all subdirectories, so the %d\* means all files in each subdirectories. But reality is it added a \.\ in the fully path name of the source, the result like this:
copy "C:\source dir\.\video.mp4" "E:\dest dir"
while it should be:
copy "C:\source dir\video.mp4" "E:\dest dir"
Any way, this format works for me, hopefully, same you some time.
For /r %d "C:\source dir" in (*) do copy "%d" "E:\dest dir"