Eu não testei em um sistema real, mas tudo bem:
@echo off
setlocal EnableDelayedExpansion
set BaseFolder=F:\!Storage\!FS Addons\!X-Plane\!Tools\!Ortho4XP\Tiles
set FileForSearch=E:\X Plane 11\X-Plane 11\Custom Scenery\scenery_packs.ini
set NewFoldersList=%~dp0\NewFolders.txt
if exist ("!NewFoldersList!") (
del /q "!NewFoldersList!" >nul 2>&1
)
for /d /r %%A in ("!BaseFolder!") do (
set tmp_FolderFound=N
for /f %%B in ("!FileForSearch!") do (
if /i not [!FolderFound!]==[S] (
if /i [%%A]==[%%B] (
set tmp_FolderFound=S
echo %%A>>"!NewFoldersList!"
)
)
)
)
if exist ("!NewFoldersList!") (
copy /b "!FileForSearch!"+"!NewFoldersList!" "!FileForSearch!" >nul 2>&1
)
setlocal DisableDelayedExpansion
endlocal