回复 2# terse
考虑到要批量处理,我改了一下,但好像不够简洁。请问下面代码可以怎样改善?- @echo off&setlocal enabledelayedexpansion
- dir/b "*-*.*" >tmp.log
- for /f "delims=" %%i in (tmp.log) do (
- set "str=%%i"
- echo 原字符 !str!
- set str1=!str: - =-!
- echo 更改后 !str1!
- set str2=!str1:-= - !
- echo 还原后 !str2!
- )
- pause
- del/f/q/a tmp.log
- exit
复制代码
|