Zip folder windows how to#
But, unlike regular folders, you need more than just a simple double-click to use the files inside it. Here’s how to open a ZIP file on a Windows PC, Mac, iPhone, and Android devices. If the folder didn’t exist before unzipping, PowerShell will create the folder and place the contents into it before unzipping.Have you received an email with a ZIP file attachment, and you didn’t know what to do with it? Just like regular digital folders, you can easily open a ZIP file on almost any computer or operating system. The destination folder specified to extract the files into will populate with the contents of the archive. Open PowerShell and type in the following command, replacing and with the path to the files you want to compress and the name and folder you want it to go to, respectively: Expand-Archive -LiteralPath -DestinationPath The process is even easier than compressing them all you need is the source file and a destination for the data ready to unzip. In addition to being able to zip files and folders, PowerShell has the ability to unzip archives. It will look something like this: Compress-Archive -Path C:\path\to\files -Update -DestinationPath C:\path\to\archive.zip
Zip folder windows archive#
It lets you replace older file versions in the archive with newer ones that have the same names, and add files that have been created in the root directory.
Zip folder windows update#
It would look something like this: Compress-Archive -Path C:\path\to\file\*.* -DestinationPath C:\path\to\archive.zipĮven after the archive is complete, you can update an existing zipped file with the use of the -Update parameter. Note: Subdirectories and the files of the root folder aren’t included in the archive with this method.įinally, if you want an archive that only compresses files in the root directory-and all its subdirectories-you would use the star-dot-star (*.*) wildcard to zip them. The command’s notation would look like this: Compress-Archive -Path C:\path\to\file\*.jpg -DestinationPath C:\path\to\archive.zip You can tell PowerShell to archive them without touching the others explicitly.
![zip folder windows zip folder windows](https://www.askdavetaylor.com/wp-content/uploads/2014/03/win8-compressed-zip-folder-1.png)
jpg, etc.) but only want to compress all of one type. Next, say you have a folder with a bunch of different file types (.doc. It should look something like this: Compress-Archive -Path C:\path\to\file\* -DestinationPath C:\path\to\archive.zip By adding an asterisk (*) to the end of the file path, you tell PowerShell only to grab what’s inside of the root directory. However, if you want to exclude the root folder from the Zip file, you can use a wildcard to omit it from the archive. To use a wildcard with Compress-Archive, you must use the -Path parameter instead, as -LiteralPath does not accept them.Ībove, we covered how to include the root directory and all of its files and subdirectories when creating an archive file. When you use the character, you can exclude the root directory, compress only files in a directory, or choose all files of a specific type. The Compress-Archive cmdlet lets you use a wildcard character (*) to expand the functionality even further.
![zip folder windows zip folder windows](https://i.ytimg.com/vi/hvIlEkxJPrU/maxresdefault.jpg)
PowerShell takes everything inside of the root directory and compresses it, subfolders and all.
![zip folder windows zip folder windows](https://winaero.com/blog/wp-content/uploads/2016/04/Windows-10-copy-zipped-folder-from-send-to-600x352.png)
In the previous example, we put the path to a directory with multiple files and folders in it without specifying individual files. Alternatively, to zip the entire contents of a folder-and all of its subfolders-you can use the following command, replacing and with the path to the files you want to compress and the name and folder you want it to go to, respectively: Compress-Archive -LiteralPath -DestinationPath