windows - Batchfile to search a string in the filepath -
i wan search specific string in file-path , double particular string.
example: if filepath c:\users\xxxx\desktop\g%h.txt
want search , %
symbol , need double c:\users\xxxx\desktop\g%%h.txt
how batch file?
in batchfiles, have escape special chars, cmd knows not treat them "special". percent-sign escaped percent-sign:
@echo off setlocal enabledelayedexpansion %%i in (*.txt) ( set name=%%i echo old name: !name! set name=!name:%%=%%%%! echo new name: !name! )
Comments
Post a Comment