Decompressing a zip file using the Windows 8.x command prompt

Hi

Using the Windows 8.x command prompt, how do I decompress a zip file with the Microsoft commands?

Thanks

June 1st, 2015 11:54am

Hi balubeto,

Are there any reasons to use command prompt?
Many software are there working on Windows.  Why don't you use them?

Best regards,
Free Windows Admin Tool Kit Click here and download it now
June 1st, 2015 7:50pm

agree with Ashidacchi, is also depend on your requirement and your environment setup

if your goal is unzip the files without any 3rd party software installed, you can check this thread

http://stackoverflow.com/questions/17546016/how-can-you-zip-or-unzip-from-the-command-prompt-using-only-windows-built-in-ca

it can be accomplished with this code using power shell (please make sure you have .NET 4.5 installed),

Add-Type -A System.IO.Compression.FileSystem
[IO.Compression.ZipFile]::CreateFromDirectory('foo', 'foo.zip')
[IO.Compression.ZipFile]::ExtractToDirectory('foo.zip', 'bar')

or you create bat file and call the powershell

powershell.exe -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('foo.zip', 'bar'); }"

There is also some possibilities if you have Java SDK installed, there is some added software from Java which make you possible to run command and unzip the files (contact software manufactured for further question

http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jar.html

June 1st, 2015 11:37pm

agree with Ashidacchi, is also depend on your requirement and your environment setup

if your goal is unzip the files without any 3rd party software installed, you can check this thread

http://stackoverflow.com/questions/17546016/how-can-you-zip-or-unzip-from-the-command-prompt-using-only-windows-built-in-ca

it can be accomplished with this code using power shell (please make sure you have .NET 4.5 installed),

Add-Type -A System.IO.Compression.FileSystem
[IO.Compression.ZipFile]::CreateFromDirectory('foo', 'foo.zip')
[IO.Compression.ZipFile]::ExtractToDirectory('foo.zip', 'bar')

or you create bat file and call the powershell

powershell.exe -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('foo.zip', 'bar'); }"

There is also some possibilities if you have Java SDK installed, there is some added software from Java which make you possible to run command and unzip the files (contact software manufactured for further question

http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jar.html

Free Windows Admin Tool Kit Click here and download it now
June 2nd, 2015 3:34am

agree with Ashidacchi, is also depend on your requirement and your environment setup

if your goal is unzip the files without any 3rd party software installed, you can check this thread

http://stackoverflow.com/questions/17546016/how-can-you-zip-or-unzip-from-the-command-prompt-using-only-windows-built-in-ca

it can be accomplished with this code using power shell (please make sure you have .NET 4.5 installed),

Add-Type -A System.IO.Compression.FileSystem
[IO.Compression.ZipFile]::CreateFromDirectory('foo', 'foo.zip')
[IO.Compression.ZipFile]::ExtractToDirectory('foo.zip', 'bar')

or you create bat file and call the powershell

powershell.exe -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('foo.zip', 'bar'); }"

There is also some possibilities if you have Java SDK installed, there is some added software from Java which make you possible to run command and unzip the files (contact software manufactured for further question

http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jar.html

I tried to run the above command:

D:\Users\Balubeto_Balubeto>powershell.exe -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('D:\Users\Public\Downloads\CdBurnerXP_v4,5,5,5571.zip', 'D:\Users\Public\Downloads'); }"

Add-Type : Unable to add the type. The assembly 'System.IO.Compression.FileSystem' was not found.
In riga:1 car:13
+ & { Add-Type <<<<  -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('D:\Users\Public\Downloads\CdBurnerXP_v4,5,5,5571.zip', 'D:\Users\Public\Downloads'); }
    + CategoryInfo          : ObjectNotFound: (System.IO.Compression.FileSyste   m:String) [Add-Type], Exception
    + FullyQualifiedErrorId : ASSEMBLY_NOT_FOUND,Microsoft.PowerShell.Commands
   .AddTypeCommand

Add-Type : Unable to add the type. One or more assemblies required are missing.
In riga:1 car:13
+ & { Add-Type <<<<  -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('D:\Users\Public\Downloads\CdBurnerXP_v4,5,5,5571.zip', 'D:\Users\Public\Downloads'); }
    + CategoryInfo          : InvalidData: (:) [Add-Type], InvalidOperationException
    + FullyQualifiedErrorId : ASSEMBLY_LOAD_ERRORS,Microsoft.PowerShell.Commands.AddTypeCommand

Unable to find the type [IO.Compression.ZipFile]. Verify that the assembly containing this type is loaded.
In riga:1 car:77
+ & { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]
<<<< ::ExtractToDirectory('D:\Users\Public\Downloads\CdBurnerXP_v4,5,5,5571.zip', 'D:\Users\Public\Downloads'); }
    + CategoryInfo          : InvalidOperation: (IO.Compression.ZipFile:String) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound

D:\Users\Balubeto_Balubeto>

but not working. Why?

Thanks

Bye

June 2nd, 2015 4:15am

Hi,

Check this article to use powershell command lines to extract zip file.

How to Extract ZIP Files Using PowerShell
http://www.howtogeek.com/tips/how-to-extract-zip-files-using-powershell/

Free Windows Admin Tool Kit Click here and download it now
June 2nd, 2015 4:48am

sorry to say, I just double check those thread, you still need Windows Server 2003 Resource Kit Tools

another thread, worth to try

http://stackoverflow.com/questions/28043589/how-can-i-compres-zip-and-uncopress-unzip-files-and-folders-with-batch-f

June 2nd, 2015 5:05am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics