本帖最后由 zaqmlp 于 2019-6-1 23:12 编辑
- @echo off
- mode con lines=3000
- set info=互助互利,支付宝扫码头像,感谢赞助
- rem 有问题,可加QQ956535081及时沟通
- title %info%
- cd /d "%~dp0"
- powershell -NoProfile -ExecutionPolicy bypass ^
- $list=@('上:3','右上:2','右:7','右下:6','下:2','左下:8','左:6','左上:5');^
- $files=@(dir^|?{($_ -is [System.IO.FileInfo]) -and ($_.Name -ne '%~nx0')});^
- $n=0;^
- $r=10001;^
- while($n -lt $files.Count){^
- for($i=0;$i -lt $list.length;$i++){^
- $arr=$list[$i].split(':');^
- if($arr[1] -gt 0){^
- for($j=1;$j -le $arr[1];$j++){^
- $m=1000;^
- $newname=$r.toString().subString(3)+'-'+$arr[0]+' ('+$m.toString().subString(1)+')'+$files[$n].Extension;^
- while(test-path -liter $newname){^
- $m++;^
- $newname=$r.toString().subString(3)+'-'+$arr[0]+' ('+$m.toString().subString(1)+')'+$files[$n].Extension;^
- };^
- write-host ($files[$n].Name+' --^> '+$newname);^
- mv -liter $files[$n].Name $newname;^
- $n++;^
- if($n -ge $files.Count){exit};^
- };^
- };^
- if($i -eq ($list.length-1)){$r++;write-host ('='*32)};^
- };^
- };
- echo;%info%
- pause
复制代码
|