Command line to Zip a file

M

Marc Lefebvre

By default,
With windows XP there is a command line to ZIP a file ?

Thank's
Marc
 
R

Ramesh, MS-MVP

In addition to Daniel, see below:

Posted by Torgeir Bakken.

The zip functionality that comes with WinXP/Win2k3 does not have a command
line interface.

Some free zip/unzip programs that can help you:

ZipGenius has a command line interface (freeware)
http://www.zipgenius.it/

PowerArchiver has a command line version as well:
http://www.powerarchiver.com

Last freeware version of PowerArchiver:
http://www.321download.com/LastFreeware/

--
Ramesh, Microsoft MVP
Windows XP Shell/User

Windows XP Troubleshooting
http://www.winhelponline.com
 
D

David Candy

CreateBlankZip.vbs FileName.zip
==========================
Set Ag=Wscript.Arguments
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.OpenTextFile(Ag(0), 8, vbtrue)
BlankZip = "PK" & Chr(5) & Chr(6)
For x = 0 to 17
BlankZip = BlankZip & Chr(0)
Next
ts.Write BlankZip

Unzip.vbs SrcFldr DestFldr
eg, unzip "C:\..\My Documents" "C:\MyZip.zip"
It doesn't matter if the source is a zip and dest is a folder EXCEPT it only works zipping if there is a msgbox as the last statement. Dunno why. Msgbox is not needed if unzipping. I think it's an object reference thing and zipping is slow. Both Folders/Zips must exist.
===================================
Set objShell = CreateObject("Shell.Application")
Set Ag=Wscript.Arguments
set WshShell = WScript.CreateObject("WScript.Shell")

Set DestFldr=objShell.NameSpace(Ag(1))
Set SrcFldr=objShell.NameSpace(Ag(0))
Set FldrItems=SrcFldr.Items
DestFldr.CopyHere FldrItems, &H214
Msgbox "Finished"
 
T

Torgeir Bakken \(MVP\)

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top