@echo off echo This batch script will generate a new folder (!) echo that will only contain the PDF files available echo in the collection (Yaoi ignored). echo The files generated are hardlinks which means echo you can delete the files in the original location echo and keep only this new folder and you'll keep only echo the PDF files and nothing else. echo Hardlinks do not actually take the space they say echo they do so don't worry about generating this even echo if you plan to keep everything in the original place. pause echo. echo. echo. echo Deleting old processment files if present. mkdir ! > nul 2> nul SET PDF=%cd%\ cd .. SET BASE=%cd%\ cd %PDF% del files.txt > nul 2> nul del files_.txt > nul 2> nul del paths.txt > nul 2> nul del paths_.txt > nul 2> nul echo. echo. echo. echo Analyzing main folder (slow process on updates). echo. echo. echo. for /R ".." %%1 IN (*.pdf) do ( (echo "%%1" | findstr "!Yaoi !EPUB !PDF" 1>NUL) || ( echo %%~dp1>> paths.txt echo %%1>> files.txt echo Analyzing: %%~n1 ) ) echo. echo. echo. echo Running Powershell commands. echo Processing analyzed data. echo. echo. echo. powershell -command "(Get-Content paths.txt).replace('%BASE%','') | Set-Content paths_.txt" echo. echo. echo. echo Paths done. echo. echo. echo. powershell -command "(Get-Content files.txt).replace('%BASE%','') | Set-Content files_.txt" echo. echo. echo. echo Files done. echo. echo. echo. echo Generation folders and files. for /f "delims=" %%2 in (paths_.txt) do ( mkdir "!\%%2" > nul 2> nul echo Creating folder: %%2 ) for /f "delims=" %%3 in (files_.txt) do ( mklink /H "%PDF%!\%%3" "%BASE%%%3" > nul 2> nul echo Creating file: %%3 ) echo. echo. echo. echo Deleting processment files. del files.txt del files_.txt del paths.txt del paths_.txt echo. echo. echo. echo Generation completed. Enjoy. pause