I would like to unzip Filename.tar.gz to Filename using single command in windows batch script All the files inside zip should go inside the Filename Folder I am trying to do in windows . I am not getting correct output. Can anyone suggest an idea
Asked
Active
Viewed 3.8k times
10
-
1try 7zip, http://superuser.com/questions/80019/how-can-i-unzip-a-tar-gz-in-one-step-using-7-zip – Rozuur Dec 05 '14 at 12:39
-
This doesnt work properly – Nirmal Anand Dec 05 '14 at 15:17
5 Answers
24
Windows Command line now supports tar from Windows 10 insider build 17063. You may try run the below command in cmd or PowerShell to see if it works:
tar -xzvf your-file-name.tar.gz

codeananda
- 939
- 1
- 10
- 16

Weifeng
- 709
- 1
- 6
- 18
-
6`tar -xvzf C:\PATH\TO\FILE\FILE-NAME.tar.gz -C C:\PATH\TO\FOLDER\EXTRACTION` is the full syntax , you seem to omit/typo the dash in front of a parameter – FantomX1 Aug 10 '20 at 01:46
-
For those that don't know what the parameters mean: `x` means extract, `z` means gzip and that the file is `.tar.gz` or `.tgz`, `v` means verbose, `f` means the next argument is the filename. – codeananda Jul 20 '23 at 15:53
5
7 zip can do that: http://www.7-zip.org/
It has a documented command line. I use it every day via scripts.
Plus: it is free and has 32 and 64 bit versions.

user_0
- 3,173
- 20
- 33
-
You are right, sorry. The best documentation is in the help installed by installer. Then you can find a good support in forum. – user_0 Dec 05 '14 at 13:28
2
Windows 10 command line supports tar command
Write the tar command as general to the Linux terminal.
tar -zxvf tar-filename.tar.gz --directory destination-folder

Karishma Sukhwani
- 487
- 5
- 10
0
in windows compand promt use quotation marks ("") when specifying the path. It will work properly
Exaple : tar -xvzf "C:/PATH/TO/FILE/FILE-NAME.tar.gz" -C "C:/PATH/TO/FOLDER/EXTRACTION"
tar -xvzf "C:/PATH/TO/FILE/FILE-NAME.tar.gz"

Dilmith Perera
- 1
- 1