I was batch-renaming my files to replace all instances of "%20" with " ".
This makes files like this:
look like this
TR 10 Construction Report.pdf
I found-and-edited a suggestion previously posted on this site. The batch file code is below:
**** CODE START ****
rem Change path as required /s All files
dir /b /s | find "%%20" > Files.txt
for /f %%a in (Files.txt) do (
set FName=!FName:%%20=" "!
copy %%a !FName! > nul
del %%a > nul
**** CODE END ****
My problem is that if this comes across a file with a comma in the filename, it dies.
So anything like this is a no-no:
My batch-file programming experience doesn't include much experience with these fancy variable manipulations - so can anyone suggest a change to avoid this comma-causing-coma?
Any thoughts or suggestions are appreciated.