I want to create a folder on the basis of pdf file name and then put this pdf file in created folder. If this folder name is already available , put the pdf file and make copy of existing file. like file1.pdf (if already available) create file1(2).pdf in the same folder.
pushd "E:\directory"
Pause
dir /b *.pdf >pdf
Pause
for /f "tokens=1 delims=. " %%i in (pdf) do md "E:\directory\"%%i&move %%i.pdf "E:\directory"%%i
Pause
del pdf