Cock RingWeb HostingSpell Check

How to extract a whole bunch of files using command line and 7zip

How to extract a whole bunch of files using command line and 7zip

So you have downloaded a shed load of mp3 albums and they are all sitting in a folder waiting for you to extract each and every rar or zip file by hand. How tedious!

Well I thought about this for a second and realized that good old 7zip has a command line interface and must be able to do this.

Low and behold you can, and really easily as well. I will show you how.

Windows 7 instructions (others may differ slightly but aren’t difficult to work out)

  • Firstly install 7zip if you haven’t already
  • It might not set itself up as an application is your system path, so unless you want to sort that out it is just as easy to drop the exe into the cmd prompt window.
  • Ok run the command prompt by clicking on the start button and typing in cmd followed by return.
  • Locate using explorer your 7zip installation and keep that window open
  • Navigate in your cmd dos prompt to the location of all of your files. (some dos experience might be needed here but remember that ‘cd’ is change directory. ‘cd..’ goes up a directory.
  • The other method for lazy people is to find the dir in another explorer window and drag the folder you want to change to into your dos window after you have typed the words ‘cd ‘ into the window. Pressing return should take you to the desired folder in dos.
  • If all is good then go back to the 7zip installed folder and drag the 7zip.exe file into you cmd dos window that has the directory with all the files you want to extract located in it. (remember to ‘dir’ if you aren’t sure it’s got all the files first)
  • This might look a bit garbeled but that’s ok.
  • To test the program is going to run just press ‘return’ and it should print out a long list of switches. This is good.
  • Now to save all that dragging and stuff just press up once on the arrow keys and you should have your command waiting for you to add the all important switches.
  • The switch to extract each zip into its own folder (assuming the archive files were zipped as folders) is as follows:
  • C:\The folder with my files>”C:\Program Files\7-Zip\7z.exe” x *.rar
  • The first bit depends on where your files are of course and the second program files bit is the default locations for 7zip so that will probably be the same.
  • ‘x’ is the extract with folder structure command
  • ‘*.rar’ is the file archive type, it may be zips or other but 7zip does most of them

There you go, that should be it. My explanation is a little long winded to make more sense for everyone. The actual process is very simple.

You will then need to delete all the rar files as that simple command doesn’t remove the archive after successful extraction.

There are more advanced switches and I will add a few extra bits here when I have had time to try them out.

There is a quite useful guide to some of the 7zip switches here at dotnetperls

VN:F [1.9.15_1155]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.15_1155]
Rating: 0 (from 0 votes)

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

About the Author

Leave a Reply