If you've ever downloaded, well, anything through your web browser,
you're probably familiar with the zip file, a compressed folder that often contains lots of other files in it.
In Windows, a zip file will appear very similarly to any other folder.
It'll just have a little zipper on the icon. Very cute.
But have you ever noticed that if you try to open up a program directly from that zip folder,
you'll get an error message which goes away only if you unzip the file first,
but only sometimes. And then other times, you can just open up a zipped file without any extra baloney.
Is there a method to this madness? To answer, it helps to understand why exactly the zip format is so common in the first place.
Not only is it just fewer clicks to download one zip file instead of a bunch of individual ones,
it also compresses the files so they take up less room on the server,
use less network bandwidth, and take less time to download.
Although these advantages have made the zip format popular,
Windows can't directly interact with the data contained inside a zipped folder.
And at first, this might seem confusing because you can just double-click a zip folder to open it,
and there's the files, just like any other folder. But that functionality had to be added to Windows,
and the operating system didn't even natively support extracting zip files in Windows Explorer
until Windows ME came out in the year 2000.
This is a major part of the reason that programs such as Winzip and Winrar were so popular during the 90s.
They were necessary unless the compressed files that you needed to open came in something called a self-extracting archive.
These had the decompression program built in so you would just download and run them,
and they would spit out the uncompressed files automatically.
But simply being able to open up and view a zip folder in File Explorer isn't the same thing as working with the files within.
Whenever you double-click a file, like an EXE that's inside a zip folder,
Windows actually unzips that file in the background without telling you.
The whole process is invisible. Windows can't run the compressed version of the EXE,
so the program is instead unzipped to a temporary folder and then it's run normally.
But there's a way that you can actually see this happen for yourself.
Next time you try to run an EXE directly from a zip folder,
first open up a Run command using the Windows key and R,
then type in this command to bring up your personal temporary folder.
If you run the EXE now, you might be able to spot it in one of those subfolders.
Now, the program might work fine if there aren't other files inside the zip that the program depends upon,
but if there are, such as DLLs, you'll get an error message
because the program can't access those files that it needs while they're still compressed inside the zip folder.
That's why it's usually important to unzip or extract the entire contents of a folder
before trying to do something like run an installer. And it's also why standalone files like images or text documents will typically work just fine
without unzipping the entire folder first. An exception would be something like a text document that had images embedded in it
that were also zipped in the folder. But not everyone likes waiting around for their zip folders to fully unzip,
so if you're impatient like me, third-party tools like 7zip or Winrar do still exist
and tend to be a little faster than Windows' built-in solution.
Third-party solutions also usually offer better features than Windows' built-in compression support,
especially if you're looking to create a compressed folder.
They'll offer more efficient compression algorithms and stronger encryption for sensitive files.
And don't worry, we won't tell on you if you never end up actually paying for Winrar.
If you guys enjoyed this video, you can like or dislike depending on how you feel.
If you really liked it, you can check out our video on how data compression works more generally
and you can leave a comment if you have a suggestion for a future video. Just don't forget to subscribe so that you catch it.