@echo off FOR /F "usebackq delims=;" %%I IN (`dir C:\Test\DIR1\*.* /s /b`) DO ( IF NOT EXIST "C:\Test\DIR1\%%~nxI" ( CALL :COPYFILE "%%I" ) ELSE ( CALL :RENAME "%%I" ) ) GOTO :EOF :COPYFILE COPY "%1" "C:\Test\DIR2" GOTO :EOF :RENAME FOR /L %%N IN (1, 1, 1000) DO ( IF NOT EXIST "j:\@PCBackup\PST\%~n1%%N%<wbr ></wbr>~x1" ( COPY "%1" "j:\@PCBackup\PST\%~n1%%N%<wbr ></wbr>~x1" GOTO :EOF ) )
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.