本帖最后由 qixiaobin0715 于 2021-12-26 17:06 编辑
- @echo off
- setlocal enabledelayedexpansion
- for /f "delims=" %%i in ('dir /b /a-d *.txt') do (
- set str=%%i
- set "str=!str:(= (!"
- set "str=!str:)=) !"
- for %%j in (!str!) do (
- set str1=%%j
- if not "!str1:~,1!"=="(" if not "!str1:~-1!"==")" set str2=!str2!%%j
- )
- ren "%%i" "!str2!"
- set str2=
- )
- pause
复制代码
|