本帖最后由 zaqmlp 于 2019-3-19 17:23 编辑
- @echo off
- mode con lines=2000
- title 互助互利,扫码头像,感谢赞助;有问题,加QQ956535081及时沟通
- cd /d "%~dp0"
- powershell ^
- $dic=New-Object 'System.Collections.Generic.Dictionary[string,Object]';^
- dir . -include *.drl,*.art,*.rou -r^|?{$_ -is [System.IO.FileInfo]}^|%%{^
- $name=$_.Name.toLower();^
- if(-not $dic.ContainsKey($name)){^
- $dic.Add($name, $_);^
- }else{^
- if($_.LastWriteTime -le $dic[$name].LastWriteTime){^
- write-host ('['+$_.LastWriteTime.toString('yyyyMMddHHmmss.fff')+']'+$_.FullName);^
- del -liter $_.FullName -Force;^
- }else{^
- write-host ('['+$dic[$name].LastWriteTime.toString('yyyyMMddHHmmss.fff')+']'+$dic[$name].FullName);^
- del -liter $dic[$name].FullName -Force;^
- $dic[$name]=$_;^
- };^
- };^
- };
- pause
复制代码
|