Answer the question
In order to leave comments, you need to log in
How to rename windows files and subdirectories, change "!" to underscore using bat script?
There is a directory in which there are subdirectories and files in the name of which there is an exclamation mark. You need to somehow recursively go over and change the "!" on the "_". How to automate this?
Answer the question
In order to leave comments, you need to log in
Check:
for %%g in (*.*) do call :s_subroutine "%%~nxg" "%%g"
goto :eof
:s_subroutine
set _sss=%1
set _ddd=%_sss:!=_%
ren %2 %_ddd%
exit /b 0
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question