There is a file named doctitle.txt which contains the title. I want to use this title to rename another file, currently name file.pdf, so I did:
for /f "delims=" %%x in (doctitle.txt) do set "DOCTITLE=%%x"
move file.pdf %DOCTITLE%.pdf
This works fine, if there no space in the title string, i.e "DocumentTitle". But fails if there is a space in the title, i.e "Document Title".
What could be done to overcome this issue?