i want to rename one or more files using cmd. but a lot of this files have a special character. example:
DCIM_!01.jpeg
DCIM_&01.jpeg
DCIM_=01.jpeg
normally, we can use this value "^" to set a especial string as simple text. but when set enabledelayedexpansion the string don't is settable
set /p mystring=!
the users define string value: !, &, = and others...
the file name is defined by other variable "FOR" to search it in the folders
so string "File" value is "DCIM_!01.jpeg"
Command to change the file name:
setlocal enabledelayedexpansion
set new_filename=!file:^%mystring%=0!
echo !new_filename!
the results on prompt is:
:=0
file:=0
DCIM_!01.jpeg
DCIM_01.jpeg
I want to rewrite "!" to "0":
DCIM_001.jpeg
when i don't use a special string the command works for me