а скажите, как тогда изменится весь скрипт?
так?:
Код:
@echo off
SETLOCAL EnableDelayedExpansion
Call :MainExe Material3
EXIT
:MainExe %folder_name%
::---------------------
set "set $d="& if "%~1"=="" GoTo:EOF
for /f "delims=" %%d in ('dir/b/s/ad "%~1.*"') do if "%%~xd"=="" (
for /f "delims=" %%f in ('dir/b/s/a-d "%%d"') do (
set "$d=%%~dpf"& set "$d=!$d:%%~dpd=%%~dpd..\..\!"
call:MoveRen "%%f" "!$d!"
))
GoTo:EOF
:MoveRen %source_file% %destin_folder%
::-------------------------------------
set "$s="& set "$n="& if "%~1"=="" GoTo:EOF
if not exist "%~2" md "%~2"||exit/b 1
:MoveRen_Loop
if not exist "%~2%~n1%$s%%~x1" move "%~1" "%~2%~n1%$s%%~x1"& GoTo:EOF
diff -q --binary "%~1" "%~2%~n1%$s%%~x1">nul&& (del/f/q "%~1"&& GoTo:EOF||exit/b 3)
set/a "$n+=1"& set "$s=0!$n!"& set "$s=_!$s:~-2!"
GoTo:MoveRen_Loop