Код:

@Echo Off
SetLocal EnableDelayedExpansion
Set base=e:\Temp\
Set folder=PSX\PSX-PSP.PSN.Collection
Set Outfolder=PSX\XPD
Del /Q /F "%base%%Outfolder%\*.*"
For /F "delims=" %%a In ('Dir "%base%%folder%" /S /A:-D /B 2^>nul') Do (
If /I "%%~xa"==".PBP" (
Set fa=%%a
Set sa=%%~za
Set /A sa/=1024
For /F "tokens=1,2 delims=\" %%k In ("!fa:%base%%folder%\=!") Do Set parent1=%%k& Set parent2=%%l
If Exist "%base%%Outfolder%\!parent2!_P1.xpd" (
Echo Files "!parent2!_P1.xpd" and "!parent2!_P2.xpd" already exists
) Else (
(Echo [Info]
Echo EID=gdp#
Echo Desc=!parent1! Part 1
Echo Size=!sa!
Echo Code=!parent2!
Echo NPage=javascript:alert^("Please wait for Part 2 to begin downloading."^);window.location="http://192.168.1.10/!Outfolder:\=/!/!parent2!_P2.xpd"
Echo [File]
Echo C=http://192.168.1.10/!folder:\=/!/!parent1: =%%20!/!parent2!/EBOOT.PBP
Echo A=http://192.168.1.10/!folder:\=/!/!parent1: =%%20!/!parent2!/DOCUMENT.DAT)>"%base%%Outfolder%\!parent2!_P1.xpd"
(Echo [Info]
Echo EID=gdp#
Echo Desc=!parent1! Part 2
Echo Size=1
Echo Code=!parent2!
Echo [File]
Echo C=http://192.168.1.10/!folder:\=/!/!parent1: =%%20!/!parent2!/KEYS.BIN)>"%base%%Outfolder%\!parent2!_P2.xpd"
)
)
)
Pause
Exit