本帖最后由 娜美 于 2021-11-25 08:57 编辑
回复 2# idwma
idwma哥 我偿试这样加入多种后缀,
idwma哥哥 可以挑选加入多种文件后缀吗
- #@&cls&powershell "type %~s0|out-string|iex"&pause&exit
- dir D:\A\*.rar,*.txt,*.zip,*.7z,*.csv|%{
- $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:\A\*.rar,*.txt,*.zip,*.7z,*.csv|%{
- $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}
- }
复制代码
|