How to unzip several *.zip archive files into separate folders?

浪尽此生 提交于 2019-12-10 11:10:25

问题


I searched with Google but I didn't find something for Windows.

How can I extract several files into several folders?

For example: a.zip, b.zip and c.zip into the folders a, b and c.

I am looking for a command prompt command or a batch file solution.

Thanks


回答1:


With using WinRAR in GUI mode:

  1. Start WinRAR.
  2. Select all the *.zip files.
  3. Click on icon Extract To in toolbar.
  4. Enter destination folder or browse to destination folder.
  5. Check the option Extract archives to subfolders in group Miscellaneous.
  6. Click on button OK.

In case of you want to know more about those extracting options, click before on button Help.

Or use from command line with current directory containing the *.zip files and all archive files which should be also extracted into subfolders of current directory with name of ZIP file as folder name:

"%ProgramFiles%\WinRAR\WinRAR.exe" x -ad -cfg- -ibck *.zip

How to build such a WinRAR command line?

  1. Start WinRAR.
  2. Click in menu Help on Help topics.
  3. Click on tab Contents on list item Command line mode.
  4. Click on list item Command line syntax, read this help page and copy the bold line into a text editor or into a command prompt window.
  5. Click on tab Contents on list item Commands.
  6. Click on list item Alphabetic commands list and replace <command> in text editor or command prompt window by most suitable command letter for the task.
  7. Click on tab Contents on list item Switches.
  8. Click on list item Alphabetic switches list and replace -<switch1> -<switchN> in text editor or command prompt window by those switches which are useful for the task.
  9. Replace the rest of the WinRAR command line in text editor or command prompt window by the appropriate file and/or folder names.

The short explanation of the most important switch -ad for this task is:

-ad     append archive name to destination path

As it can be seen here, WinRAR supports even a wildcard pattern as archive file name for extracting all archives files matching the pattern.

One more method exists with shell integration enabled as by default after installation of WinRAR.

  1. Select the archive files to extract in file manager (Windows Explorer).
  2. Click with secondary (right) mouse button on one of the selected files to open the context menu.
  3. Open context submenu WinRAR if there is such a submenu because of enabled setting Cascaded context menus in WinRAR - Options - Settings - Integration.
  4. Click on context menu item Extract each archive to separate folder.


来源:https://stackoverflow.com/questions/38878420/how-to-unzip-several-zip-archive-files-into-separate-folders

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!