5

7z.exe do not show any extraction progress in cmd."C:\Program Files\7-Zip\7zG.exe" -y x -pPASSWORD "D:\Myfile.rar" Extracts the file with a GUI progress-bar. But I don't want a GUI progress bar. I want to show the progress in terms of percentage inside cmd. i.e, I want to use 7z.exe instead of 7zG.exe with percentage progress shown.

Deb
  • 219

3 Answers3

5

There is (currently) no way to display a native progress bar at the command line. There are a lot of (dirty) hacks out there, from counting the extracted files while extracting to continously getting the size of the extracted file or directory. I would not recommend those - if you can, use the gui. If not, just let it happen :-)

bjoster
  • 375
1

I have been about to get progress information using 7z.exe version with the command line:

7z.exe a archive.7z c:\testfolder -r -bsp2

-1

The standard 32 and 64 bit '7-zip Extra' application accepts command line input and provides a percentage complete indicator, however I should note that this does not happen within the active CMD window, it does start its own application window, although once complete will close itself and your script will carry on as per usual.

  1. Download the below source files from here: http://www.7-zip.org/download.html

    DESCRIPTION: 7-Zip Extra: standalone console version, 7z DLL, Plugin for Far Manager

  2. Retrieve the 7za.exe, 7za.dll, and 7zxa.dll files (I suggest only using the 32 bit files sitting outside of the x64 folder as they work on both architectures where x64 does not).

  3. Place these files in the same folder somewhere within your payload, or in an accessible location from your script and where the user running the script has rights to access both files.
  4. Refer to the 7-zip.chm for the command line and syntax information to create your script (this is not included in the download, and can be found in the standard install Program Files after installation), or refer to this very basic and helpful site: https://sevenzip.osdn.jp/chm/cmdline
Random206
  • 103
  • 4