本帖最后由 idwma 于 2022-3-20 17:02 编辑
- #@&cls&powershell "type %~s0|out-string|iex"&pause&exit
- $a=gc a.txt
- $shell=(new-object -com Shell.Application).namespace("$pwd")
- $a|%{
- $n=$_ -split ','
- $shell.items()|?{$_.name -eq $(gi "$($n[0])*").name}|{
- $wh=if($shell.GetDetailsOf($_, 31) -ne ''){
- $shell.GetDetailsOf($_, 31) -split 'x' -replace '[^\d]'
- $type='视频'
- }elseif($shell.GetDetailsOf($_, 285) -ne ''){
- $shell.GetDetailsOf($_, 285)
- $shell.GetDetailsOf($_, 283)
- $type='图片'
- }
- if($wh -ne $null){
- $nn='{0:d6}' -f [int]$($_.name -replace "$n[0]" -split '.')[0]
- ren $_.name $('{0}{1}__{2}--({3}x{4})--{5}' -f $type,$n[1],$nn,$wh[0],$wh[1],$_.name)
- rv wh
- }
- }
- }
复制代码
|