I have a folder lets call it e:\camera which has sub folders 1 through 20 each sub folder has one or more videos taken with the camera and each file name starts with MOVYYY through MOVZZZ for each file in the folder.
I need to move them all into one folder and rename them so there are no duplicate’s. How can I easily do this on XP/Vista/W7
Example
Folder 1 has MOV001 through MOV004
Folder 2 has MOV001 through MOV005
Folder 3 has MOV001 through MOV002
Paste the script below into a text file with a .cmd extension. Customize the value of the source variable on line 4 with the location of the folder containing the numbered folders. Customize the value of the dest variable on line 5 with the location of the folder to move all of the pictures to.
Running the script will echo commands to move each file to the new directory, prepending the previous path to the name, with dashes substituted for the backslashes. This should prevent there from being any duplicate-apostrophe-s.
Once you have tested it successfully and are sure it will do what you want, remove the word ECHO from line 10 to execute the commands.
@echo off
setlocal enabledelayedexpansion
set source=e:\camera
set dest=c:\videos
for /F "tokens=*" %%G in ('dir "%source%" /A:-D /B /S') do (
set newname=%%~pnxG
set newname=!newname:\=-!
ECHO move "%%G" "%dest%\!newname:~1!"
)
pause