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:要去除的字符串=!")
原文地址:https://www.cnblogs.com/xuandi/p/9532942.html
时间: 2024-10-08 04:03:25