- @echo off
- set info=互助互利,支付宝扫码头像,感谢赞助
- rem 有问题,可加QQ956535081及时沟通
- title %info%
- cd /d "%~dp0"
- set "指定字符串=xxx"
- set confirm=1
- powershell -NoProfile -ExecutionPolicy bypass ^
- $files=@(dir -liter '%~dp0' -r^|?{($_.Name -ne '%~nx0') -and ($_.Name.contains('%指定字符串%')) -and ($_ -is [System.IO.FileInfo])});^
- if($files.length -gt 0){^
- if('%confirm%' -eq '1'){^
- write-host (@($files^|%%{$_.FullName}) -join \"`r`n\");^
- write-host '确定删除以上文件?按任意键继续...' -ForegroundColor red;^
- [void][System.Console]::ReadKey(1);^
- };^
- for($i=0;$i -lt $files.length;$i++){del -liter $files[$i].FullName -force};^
- }
- echo;%info%
- pause
复制代码
|