up vote 1 down vote favorite
share [g+] share [fb]

PROBLEM: I would like to be able to extract tar.gz files in a single step. This makes my question almost identical to this one: stackoverflow question for tar-gz.

My question is almost the same, but not the same, because I would like to do this on windows using 7zip command-line (or something similar) inside a bat file or ruby/perl/python script.

QUESTION: This seemingly simple task is proving to be more involved than the first appearance would make it out to be. Does anyone have a script that does this already?

link|improve this question

70% accept rate
If it's so similar to that question, doesn't this belong on Stack Overflow? – jtbandes Aug 31 '09 at 23:06
I already asked there, but someone on stackoverflow voted to move it here, so i asked here in case it got erased. There's always the "grey area" questions that could be on both sites, this seems like one of them. – user2499 Sep 1 '09 at 0:05
feedback

3 Answers

up vote 1 down vote accepted

Perhaps the GnuWin32 ports of gzip and tar are what you need (scroll down)

link|improve this answer
feedback

Maybe try something like adding a temporary .tgz extension?

MOVE %1 %1.tgz
7z x %1.tgz
MOVE %1.tgz %1

I might be wrong, but I believe 7zip will unzip tgz files all at once (instead of with tar.gz files).

link|improve this answer
feedback

Try the tartool utility http://tartool.codeplex.com/

I was frustrated by the lack of a cmd line utility for such a simple task and created it for this exact reason.

The code is open source and uses SharpZipLib library.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.