Windows 2008 R2 unzip command

I noticed that when a zip file is read using Win 2008 Explorer,
the Explorer is able to extract out the files from the zip.

In 7-zip, I can issue  '7z -l zipfile' to view contents of a zip file
& as a way to verify the zip file's integrity is intact.

Without 7-zip, winzip or any 3rd party, what's the equivalent
Windows 2008 command to view the contents of a zip file
(without getting into Explorer).

Reason I need this is I'm writing a Windows batch script to
check integrity of a zip file that is ftp'ed (get) over from a
remote ftp server.

In 7-Zip, I'll issue "7z -l zipfile" & then test the errorlevel ie
7z -l zipfile
if %errorlevel% NEQ 0 echo zipfile is bad
if %errorlevel% EQ 0 echo zipfile is good
Who is Participating?
arnoldConnect With a Mentor Commented:
Windows is primarily a graphical setup and many of its features are built into the graphical response.  The mechanism to open/extract the data is built-into explorer without an equivalent command line executable.  Using vbscript, powershell cmdlets is likely how you can get to do some, but the scope of the information you want/need might not be available without using alternate tools.
TunerMLConnect With a Mentor Systems EngineerCommented:
The 'compress' utility found on the W2k3 resource kit provides only basic functionality, for that end you could use it on the W2k8 server. I do not believe that it was even included in the W2k8 resource kit and therefore without a third party option you may be unable to complete this. Most admins I know use 7-zip as a full functional command line zip utility. 'Compress' is a very limited utility and most likely will not have a command line option to do integrity testing. Another expert may be able to shed more light but I am quite confident in my response.
sunhuxAuthor Commented:
Just to add a bit:
my client disallows freeware/opensource tools (eg: 7zip)
to be installed on their Win2008 servers & they're not
prepared to pay for Commercial zipping tools so we
have to use Windows native zip/unzip.  The remote end's
management paid for Commercial zipping tool.

Can't use expand or compress commands as these commands
don't 'zip' up all files into one single zip file (as far as I understand)
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

arnoldConnect With a Mentor Commented:
AlexPaceConnect With a Mentor Commented:
Here is an idea that is outside the box: Some FTP servers support integrity checking with CRC, MD5, SHA1 etc... You could use this feature to validate the accuracy of the file transfer so at least you'll know that if the zip file is somehow invalid then the source file on the remote server is also invalid in the exact same way.  

Another idea is to use a scriptable FTP client with error handling that includes zip capability in the scripting.  This way you could just attempt to unzip it and trap any error.  If no error you know it works.  

Another idea... have them PGP encrypt the zip file.  Attempt to decrypt the file.  If the transfer was not perfect the decryption will fail.
sunhuxAuthor Commented:
AlexPace, the customer disallows any 3rd party/Opensource ftp
client & ftp server;  only MS ftp server & MS ftp client is allowed:
does MS ftp'ies have these features?

To re-emphasize, no 7-zip, freezip or freeware zips allowed while
they're not going to pay for commercial zip tools even if it costs
only US$10 for a commercial tool (unbelievable demand but that's
what my customer's policy is).

Arnold, what you gave in that url looks like a Powershell script,
not a VB.  I can use PS but what's the syntax to use that script
& what's the equivalent of '7z.exe -l zipfile' ?  Pls give examples.

I'm Powershell illiterate
sunhuxAuthor Commented:
> what's the syntax to use that script & what's the equivalent of
> '7z.exe -l zipfile' ?  Pls give examples

Also, after executing that PS script, can I check its status by
' if %errorlevel% NEQ 0 ...... " ?

Also, give me a sample command of that PS script to unzip
a zipfile
arnoldConnect With a Mentor Commented:
I provided an example of a reference powershell script that you can test to see what information you can glean from it.
The reference to VB was a suggestion to explore whether a similar capacity/capability exist in vb the problem is that several links I ve thought of including refer to loading referencing resources outside the built into the MS OS.
IMHO, exploring a functionality of a script in a language I am not familiar helps to understand the I.e. you know the input and what you want to explore along withthe source data.
I am not in a position to dissect the powershell code to address directly your followup question.
sunhuxAuthor Commented:
Just one last question:

my customer asks:  since it's possible to unzip
from Windows Explorer (in Win 2008 R2), isn't
there any equivalent command (at command
line) to do zip & unzip in Win 2008 ?  If there
is, what's those commands?
All Courses

From novice to tech pro — start learning today.