本帖最后由 went 于 2021-2-3 21:38 编辑
注意有中文的脚本要保存ansi编码
1.- @echo off & cd /d "%~dp0"
- for %%i in ("*aa*") do del %%i
- pause&exit
复制代码 2.- @echo off & cd /d "%~dp0"
- set "folder1=文件夹1"
- set "folder2=文件夹2"
- for %%i in ("%folder2%\*") do (
- for %%a in ("%folder1%\*%%~ni*") do (
- del "%%a"
- )
- )
- pause&exit
复制代码 3.- @echo off & cd /d "%~dp0"
- set "folder1=文件夹1"
- set "folder2=文件夹2"
- for %%i in ("%folder2%\*") do del "%folder1%\%%~nxi" 2>nul
- pause&exit
复制代码
|