Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.
An undefined problem has an infinite number of solutions.—Robert A. Humphrey
But what I'm wondering is...when using Sidewinder's code, how can I prevent overwriting? I'm not too worried about it with xcopy, but it's a problem with his code....
Better yet, how could it be set up to automatically rename like-named files (California(1).mp3, California(2).mp3, etc.)?
@echo offsetlocalset Source=C:\Documents and Settings\Owner.Murgatroyd7\Desktop\testset Dest=C:\Documents and Settings\Owner.Murgatroyd7\Desktop\curiousfor /f "delims=" %%a in ('dir "%Source%\*.mp3" /b /s') do ( if exist "%Dest%\%%~na%%~xa" ( call :IncrementFile "%%a" ) else copy "%%a" "%Dest%" )goto :EOF:IncrementFilefor /l %%b in (1,1,99) do ( if not exist "%Dest%\%~n1(%%b)%~x1" ( copy %1 "%Dest%\%~n1(%%b)%~x1" exit /b ) )
if not exist "%Dest%\%~n1(%%b)%~x1" ( copy %1 "%Dest%\%~n1(%%b)%~x1"
And thanks for the links, Willy.
I'm going to read up on those when I have some free time tonight.