- @echo off
- set info=互助互利,支付宝扫码头像,感谢赞助
- rem 有问题,可加QQ956535081及时沟通
- title %info%
- cd /d "%~dp0"
- powershell -NoProfile -ExecutionPolicy bypass ^
- $files=@(dir^|?{($_ -is [System.IO.FileInfo]) -and ($_.Name -ne '%~nx0')});^
- for($i=0;$i -lt $files.Length;$i++){^
- $newname=[regex]::replace($files[$i].BaseName,'\(Ver\.[^^\)]*?\)',{param($a);$a.value.trim('()')});^
- $newfile=$newname+$files[$i].Extension;^
- if($files[$i].Name -ne $newfile){^
- $n=1;^
- while(test-path -liter $newfile){^
- $newfile=$newname+'_'+$n.toString()+$files[$i].Extension;^
- $n++;^
- };^
- write-host ($files[$i].Name+' --^> '+$newfile);^
- mv -liter $files[$i].Name $newfile;^
- };^
- };^
- write-host '%info%' -ForegroundColor green;
- pause
复制代码
|