|I have 100s of filenames with an end bracket in them. i.e : ")"|
My batch crashes everytime a filename with an end bracket ) in its name gets used. I assume its because of the code below:
FOR /F "usebackq" %%A IN ('%vare1%') DO set svare1=%%~zA
I need to be able use the above code to determine the size of a file, so I was wondering if there's a way to automatically get the ) replaced in a filename through a batch.
From this site Ive learned there are 2 ways to replace letters in the name of a filename . Unfortunately, both codes are unable to get rid of the ) in a filename when I tried to replace them with "aaaa"
FOR %%a IN (*.jpg) DO (
CALL SET Var=%%Var:)=aaaa%%
CALL REN "%%a" "%%Var%%.jpg"
FOR /f "tokens=*" %%a IN ('DIR /b "*.jpg"') DO (
REN "%%a" "!Var!.jpg"
Thanks again for your knowledge