|The below code works fine to replace exclamations found in any filename and replaces them with an "a", however I have a big batch where this code is included and the problem is if the words:|
"setlocal ENABLEDELAYEDEXPANSION" are used anywhere in the batch before this code, the code doesnt replace the exclamation marks and instead says :
" =a% was not expected at this time"
What do I type to turn off the
command when the batch goes to this code and why does this happen?I use the setlocal command to set different lines as variables in a text. For some reason it only happens with exclamations and not with end brackets or anyother characters I want to replace. Thanks.
FOR %%a IN (*.*) DO (
CALL SET Var=%%Var:!=a%%
CALL REN "%%a" "%%Var%%.*"