cd /d "F:\test\"
for /f "delims=" %%a in ('dir /s /a-d /b E:\move\LVU-*.jpg') do (
for /f "delims=_" %%i in ("%%~na") do (
move /y "%%a" F:\tes
)
)
How do I check here whether there is already a JPG file with the same name in the F:\test\ directory, and if there is, rename it before distributing it? For example: both F:\test\ and E:\move\ have LVU-001_1.jpg. After running it, the LVU-001_1.jpg in E:\move\ should be renamed to LVU-001_1(2).jpg and then distributed into the F:\test directory. In other words, after execution, F:\test\ should contain both the original LVU-001_1.jpg and the distributed LVU-001_1(2).jpg
QuestionING
for /f "delims=" %%a in ('dir /s /a-d /b E:\move\LVU-*.jpg') do (
for /f "delims=_" %%i in ("%%~na") do (
move /y "%%a" F:\tes
)
)
How do I check here whether there is already a JPG file with the same name in the F:\test\ directory, and if there is, rename it before distributing it? For example: both F:\test\ and E:\move\ have LVU-001_1.jpg. After running it, the LVU-001_1.jpg in E:\move\ should be renamed to LVU-001_1(2).jpg and then distributed into the F:\test directory. In other words, after execution, F:\test\ should contain both the original LVU-001_1.jpg and the distributed LVU-001_1(2).jpg
QuestionING
