windows 下 方便工作的bat文件批处理命令

1.删除目录下 不包含某串字符的文件:

@echo off
for /f "delims=" %%a in ('dir /s /a-d/b *.mp3') do (
echo "%%~nxa" | find "_C96kbps.mp3" >nul || del /f/q "%%~a"
)
pause

 

2.批量去除文件名里 含有的某些字符串:

@echo off& setlocal enabledelayedexpansion
for /f "delims=" %%1 in ('dir /a /b') do (set wind=%%1
ren "%%~1" "!wind:要去除的字符串=!")

 

 

http://qbview.url.cn/getResourceInfo?appid=31&url=http://xx.cc

posted @ 2018-08-25 09:20  hellohyi  阅读(631)  评论(1编辑  收藏  举报