本帖最后由 idwma 于 2021-11-24 22:14 编辑
- #@&cls&powershell "type %~s0|out-string|iex"&pause&exit
- dir D:\A|%{
- $c=[IO.File]::OpenRead($_.fullname)
- $d+=@([BitConverter]::ToString([Security.Cryptography.MD5]::Create().ComputeHash($c)).Replace("-","")+" "+"$_.name")
- $c.Close()
- }
- out-file -input $d -enc default a.md5.txt
复制代码
- #@&cls&powershell "type %~s0|out-string|iex"&pause&exit
- $a=type a.md5.txt
- dir D:\B|%{
- $c=[IO.File]::OpenRead($_.fullname)
- $b=[BitConverter]::ToString([Security.Cryptography.MD5]::Create().ComputeHash($c)).Replace("-","")
- $c.Close()
- if($a -match $b){del $_.fullname}else{out-file -input "$b $_.name" -enc default a.md5.txt -append}
- }
复制代码
|