The Problem:

Everytime I downloaded a zipped file through the browser, the usual steps to be followed in order to actually get to see the contents were:

  1. Download the zipped file.
  2. Browse to the Download directory of my browser.
  3. Right click, choose the extract option, extract.
  4. Open the folder that the files got extracted to.

Download a rar file 

Open the download folder 

Extract the archive

Open the folder

Not a lot of steps I agree, but doing it over and over again is hard work. And I’m a pretty lazy guy. ^.^

The Solution:

Simple! I wrote a tiny batch script that does all the above steps for me. In 2 seconds flat! All you need is the 7-zip file manager and my batch script.

Set it up:

Download and install the free, open-source 7-zip file manager. It’s the only software you will ever need for your archive extracting needs.

Next, copy the following lines into notepad and save it as extract.bat (make sure the extension gets changed). Keep it somewhere for quick access, like the desktop.

@ECHO OFF

::ddir is the browser's downloads directory
set ddir=c:\users\pig\downloads\

::odir is the output directory where the zip file will be extracted
set odir=C:\Users\pig\Downloads\ExtractedFiles\

set dcom=dir /B /TC /OD %ddir%*.zip %ddir%*.gzip %ddir%*.7z %ddir%*.rar %ddir%*.tar %ddir%*.gz

for /F %%a in ('%dcom%') do (
set temp=%%a
)

echo Extracting %temp% ......

mkdir %odir%%temp%
”C:\Program Files\7-Zip\7z.exe” x %ddir%%temp% -o%odir%%temp%

explorer %odir%%temp%

The changes you need to make:

The lines in red will need your attention:

  1. Modify ddir to point to your browser’s downloads directory.
  2. Modify odir to point to the directory that you want the zip files to get extracted into.
  3. Modify the path to 7z.exe if you have not opted for the default installation directory for 7-zip.

So after the above 2 modifications, whenever you download a zip, rar, tar, gzip, gz, 7z file, all you have to do is run this batch file. It will:

  1. Search for the latest zip file in the browser’s downloads directory.
  2. Extract it into the output directory you specified.
  3. Open the folder containing the extracted files for super quick access. :)

Considering the fact that most of the files that we download are in a compressed archive, this script comes in handy in eliminating the repetitive task of extracting them manually.

You may also like to read:
  1. How to convert CBR to CBZ and CBZ to CBR [Comic files]
  2. Read CBR or CBZ files (comics and graphic novels) [How to]
  3. Switch from Wireless to Wired using batch files
  4. Foobar Last.fm Plugin – Play Last.fm radio from Foobar