像下面,文件路径中带有括号,在 for循环in语句中,如何转义括号,使得不提醒语法错误:
“此时不应有 \thunder。”- set "p1=C:\Program Files (x86)\thunder network\中 (1) 文\1.txt"
- for /f "eol=* delims=" %%i in ('"findstr /i /n .* "%p1%" "') do (
- .......
- )
复制代码 使用过失败的方法:
(1) set "p1=C:\Program Files ^(x86^)\thunder network\中 ^(1^) 文\1.txt"
(2) set "p1=C:\Program Files \^(x86\^)\thunder network\中 \^(1\^) 文\1.txt"
(3) set "p1=C:\Program Files ^(x86^)\thunder network\中 ^(1^) 文\1.txt"
for /f "usebackq eol=* delims=" %%i in (`"findstr /i /n .* "%p1%" " `) do ( |