Using 7-zip Command Line to Unzip Multiple Folders
Posted: 08 Feb 2020 21:51
I have a bunch of videos that were downloaded via BitTorrent. Most of them were broken up into multiple segments in their individual folders. I am trying to create a batchfile that will allow me to drag and drop multiple folders onto it, and then if it finds a .RAR file in a folder, it will uncompress the .RAR file, then go onto the the next folder and do the same.
The segments look like this:
this.is.the.file.name.rar
this.is.the.file.name.r00
this.is.the.file.name.r01
this.is.the.file.name.r02
this.is.the.file.name.r03
...Etc...
So far, I can only get 7z (the 7-Zip command line program) to un-rar a .RAR if I have the batchfile in he same folder as the .RAR and only when I drag and drop the .RAR onto the batchfile, which doesn't provide any functional benefit.
Here is the batchfile so far (hardly even a batchfile yet):
@echo off
"C:\Program Files\7-Zip\7z.exe" x -r *.rar
echo.
pause
I can't figure out how to tell 7z how to open up a folder to find the .RAR, nor how to have it go to another folder after, if I drag and drop multiple folders onto it.
Even if I could get it to work by dragging just one folder at a time to it, I'd be happy.
If anyone needs to see the command and switch list instructions for 7z, here is a text file of all of them for the newest stable version of 7z:
http://noyou.net/7zip/7z.exe_CMD_Instructions.txt
The segments look like this:
this.is.the.file.name.rar
this.is.the.file.name.r00
this.is.the.file.name.r01
this.is.the.file.name.r02
this.is.the.file.name.r03
...Etc...
So far, I can only get 7z (the 7-Zip command line program) to un-rar a .RAR if I have the batchfile in he same folder as the .RAR and only when I drag and drop the .RAR onto the batchfile, which doesn't provide any functional benefit.
Here is the batchfile so far (hardly even a batchfile yet):
@echo off
"C:\Program Files\7-Zip\7z.exe" x -r *.rar
echo.
pause
I can't figure out how to tell 7z how to open up a folder to find the .RAR, nor how to have it go to another folder after, if I drag and drop multiple folders onto it.
Even if I could get it to work by dragging just one folder at a time to it, I'd be happy.
If anyone needs to see the command and switch list instructions for 7z, here is a text file of all of them for the newest stable version of 7z:
http://noyou.net/7zip/7z.exe_CMD_Instructions.txt