amuck-landowner

[Powershell] Automatic unrar of files in subdirectories + rescene

William

pr0
Verified Provider
Was used for downloading, very useful. Observe legality of usage in your country.


Seems to still work without any issues (Win 8/2012).
Requires (duh) rar in path and rescene (srr.exe) in

Code:
foreach ($file in Get-ChildItem -name -exclude unpack.ps1) {
cd $file
$SFV = ls -name -include *.sfv
C:\srr.exe "$PWD\$SFV" -s *.nfo
$rarfile = ls -name -include *.rar -exclude *.part*.*
if (!$rarfile) { $rarfile = ls -name -include *.part01.rar }
if (!$rarfile) { $rarfile = ls -name -include *.001 }
rar x $rarfile
$rmfile = ls -name -exclude *.avi,*.srr,*.mkv
rm -recurse $rmfile
cd ..
echo $file "Rescened, Unrared and files deleted!"
}
 

William

pr0
Verified Provider
I cant even tell how hard it was to write this in PS... took a lot of time to figure it out right and i still don't understand half of it...
 
Top
amuck-landowner