Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to extract a zip file on Server Core 2008.

Can anyone tell me the command to do so?

share|improve this question
    
Move this question to one of the other trilogy sites, please. It doesn't belong here. –  David Pfeffer Jan 5 '10 at 4:22
    
I think the question is okay for Serverfault. –  splattne Jan 5 '10 at 9:09
add comment

migrated from stackoverflow.com Jan 5 '10 at 4:38

This question came from our site for professional and enthusiast programmers.

3 Answers

You could use this code snippet for a .vbs file (VBScript):

Function WindowsUnZip(sUnzipFileName, sUnzipDestination)

  Set oUnzipFSO = CreateObject("Scripting.FileSystemObject")

  If Not oUnzipFSO.FolderExists(sUnzipDestination) Then
    oUnzipFSO.CreateFolder(sUnzipDestination)
  End If

  With CreateObject("Shell.Application")
       .NameSpace(sUnzipDestination).Copyhere .NameSpace(sUnzipFileName).Items
  End With

  Set oUnzipFSO = Nothing

End Function

Call WindowsUnZip("C:\example.zip", "C:\DestinationFolder\")
share|improve this answer
add comment

There is no command line utility buit in to unzip files. When copying files to server core I recommend using makecab and expand. Or you can install the unzip command line tool of your preference.

share|improve this answer
1  
7-zip.org Has a good command line version. –  Qwerty Jan 5 '10 at 5:16
    
yeah I've had issues with 7-zip. Like most open source software, YMMV. –  Jim B Jan 5 '10 at 5:37
add comment

zip.exe and unzip.exe are in my tools folder since 1994 and they work fine in Server Core. I use the versions from Info-ZIP

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.