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

Posted xuandi

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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:要去除的字符串=!")







以上是关于windows 下 方便工作的bat文件批处理命令的主要内容,如果未能解决你的问题,请参考以下文章