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

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -