Here’s a clean and safe batch script that will move files from one folder to another, creating the destination folder if it doesn’t exist, and without overwriting existing files:
@echo off
set "source=C:\SourceFolder"
set "destination=C:\DestinationFolder"
REM Create destination folder if it doesn't exist
if not exist "%destination%" (
mkdir "%destination%"
)
REM Move files without overwriting
for %%F in ("%source%\*") do (
if not exist "%destination%\%%~nxF" (
move "%%F" "%destination%"
) else (
echo Skipped existing file: %%~nxF
)
)
echo Done!
pause
Let me know if you need any help. Feel free to ask any question