What command to use to unpack a .tar.gz file in Windows?

Posted on


I use to receive tar.gz files fromm colleagues but unpacking them with 7zip is not convenient as it unpacks a tar file from gz first while I usually seek to get the tar file contents (so I have to unpack the tar file explicitly next).

I’ve tried adding tar -zxvf %P%N command to Total Commander button bar but it turned that tar -zxvf doesn’t work but returns the following error (tried it in bare command prompt):

tar: Cannot fork: Function not implemented
tar: Error is not recoverable: exiting now

I have got both GnuWin32 and cygwin installed, but I seek a solution that will work in Windows command line promt (and so will be callable from Totat Commander), not in cygwin command line promt.


To extract .tar and .tar.gz files on Windows 9x/NT/2000/ME/XP/Win7 use PowerArchiver 6.1 (freeware) or 7-zip (freeware) or Winzip (commercial).


This happens because you have like multiple tar.exe, and one of them might be provided by git on windows. In terms of fixing this problem, you might want to adjust the order of path. Try putting the path for the real tar at the beginning of the PATH env.

Windows 10 (and higher) now include the tar you expect. So, today, you can use that directly.

Alternatively, there is a solution with 7z. From: https://superuser.com/a/546694/653985

7z x "somename.tar.gz" -so | 7z x -aoa -si -ttar -o"somename"

Try to using command prompt with admin and try this way. it worked for me
tar -xvzf D:Fprometheus-2.19.2.windows-amd64.tar.gz -C D:WebHTML