-2

My team is working with .GZ files and they need some way, ANY WAY, to extract a .GZ from command line. It can be using Java commands (as long as it can be run from CMD). If it can be done with a third party PORTABLE executable that is fine as well, as long as it's free. I don't have much to go on here so I'm giving the most information as I can. Basically in a nutshell:

  • I need to open .gz files
  • It has to be done through a Batch file (CMD)
  • It cannot use anything that must be installed apart from Java.
  • It can use a portable EXE (toggleable from CMD)

Thanks a bunch, sorry it is low on information! -Lucas E. Executive Programmer for EDG

Side note: This goes along with minecraft, so, I know I can somehow make and extract them since minecraft saves it's log files in .gz format. If the item I need comes with minecraft I can work with that.

Matthew Lock
  • 13,144
  • 12
  • 92
  • 130
EDG
  • 133
  • 1
  • 3
  • 9
  • What have you guys tried? Why does this have anything to do with Minecraft? – LeoColman Jan 27 '17 at 20:38
  • 2
    This is still not a site to request code for free! Please do your own research, share your efforts and precisely describe what you have problems with! Read the [tour] and learn [ask] here! – aschipfl Jan 27 '17 at 20:56
  • Asking for what to use to do one particular thing from a batch file is pretty much a question on batch file programming – infixed Jan 27 '17 at 21:19
  • Cant figure out much, don't know where to go – EDG Jan 27 '17 at 22:09
  • I did my research aschip, so did they. Dude, I'm not going to go on here for free code. I came up with nothing that did not require an install. I did not know the 7zip was portable. – EDG Jan 27 '17 at 22:10
  • Your going to have to trust your users a little bit. When I'm asking for something, it is after I have spent at least twenty minutes googling and experimenting and come up with nothing. At this point I'm considering switching to a new website due to this reaction from the staff and other users. – EDG Jan 27 '17 at 22:19
  • I recommend you look at the questions on this site that have high ratings; they also did their research, but they explicitly stated what they found in their question to prove that they actually did the research. This is the minimum level of detail we expect on this site. You got downvoted because it didn't _look_ like you did any research (well, that and software recommendation requests are off-topic). We aren't mind readers, and an alarming number of new users actually _haven't_ done any research. – SomethingDark Jan 28 '17 at 00:31
  • take a look [**here**](http://stackoverflow.com/questions/28043589/how-can-i-compress-zip-and-uncompress-unzip-files-and-folders-with-bat) . You can do this without external binaries. the `shell.application` and `jscript.net` methods will be capable to unzip a gzip file. – npocmaka Jan 28 '17 at 08:05

2 Answers2

5

The 7Zip utility can uncompress a gzip file

7z.exe x file.gz -so > uncompressed.dat

7z.exe is portable if you bring its DLLs along (just 7z.dll I think)

It's free in that you personally can use it without payment. It you want to distribute it with a commercial product you may have to contact the owners.

I have seen it mentioned by name when included in a 3rd party product. "Powered by 7zip" But the license on the site reads (in part)

7-Zip
  ~~~~~
  License for use and distribution
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  7-Zip Copyright (C) 1999-2016 Igor Pavlov.

  Licenses for files are:

    1) 7z.dll: GNU LGPL + unRAR restriction
    2) All other files:  GNU LGPL

  The GNU LGPL + unRAR restriction means that you must follow both 
  GNU LGPL rules and unRAR restriction rules.


  Note: 
    You can use 7-Zip on any computer, including a computer in a commercial 
    organization. You don't need to register or pay for 7-Zip.

http://7-zip.org/

infixed
  • 1,155
  • 7
  • 15
1

Java has built-in code for handling gzip streams but it's not accessible from the command line (e.g. you cannot type java -blah and ungz something). If you have access to the Java compiler you can write a small program to ungz your file.

Another option would be to download GNU gzip for Windows (if using Windows) and use the binaries in that package. Any non-windows OS should already have "gunzip" installed, so you wouldn't have to provide anything extra.

Gerco Dries
  • 6,682
  • 1
  • 26
  • 35