windows批量去掉空格和括号

@echo off&setlocal enabledelayedexpansion

for /f "delims=" %%i in ('dir /s/b *.*') do (

    set "foo=%%~nxi"

    set foo=!foo: =!

    set foo=!foo: =!

    ren "%%~fi" "!foo!"

)

exit

-------------------------------------------------

@Echo Off&SetLocal ENABLEDELAYEDEXPANSION
 
FOR %%a in (*) do (
 
set "name=%%a"
 
set "name=!name:(=!"
 
set "name=!name:)=!"
 
ren "%%a" "!name!"
 
)

转自:https://jingyan.baidu.com/article/20095761fb5090cb0721b4ac.html

转自:https://blog.csdn.net/fengda2870/article/details/68066324

发布了233 篇原创文章 · 获赞 7 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/china_squirrel/article/details/103490184