How to extract ZIP files with WinRAR command line?

后端 未结 4 1457
一个人的身影
一个人的身影 2021-02-07 09:30

While trying to extract zip files I get the error:

c:\\path\\name.zip is not RAR archive
No files to extract

My code is:

4条回答
  •  旧巷少年郎
    2021-02-07 10:12

    Free unrar.exe and console versionRar.exe of WinRAR support only RAR archive format. That is clearly described in second paragraph in manual for Rar.exe which is the text file Rar.txt in program files folder of WinRAR.

    You need to use WinRar.exe instead which supports also other archive formats:

    [path\winrar.exe] x [switches] [path to zip file] [files to extract, . for all files] [path folder to extract to]

    Example:

    "%ProgramFiles%\WinRAR\winrar.exe" x -ibck c:\file.zip *.* c:\folder\
    

    The syntax, commands and switches for GUI version WinRAR.exe are listed and described in help of WinRAR. Click in menu Help on menu item Help topics, open on help tab Contents the item Command line mode and read the help pages listed under this item.

    For example the switch -ibck supported only by WinRAR.exe but not by Rar.exe is for running the extraction in background which means GUI version of WinRAR makes the extraction minimized to an icon in Windows system tray.

提交回复
热议问题