Unzip archives from the command prompt (...or script)

  • Thread starter Thread starter Giuseppe R.
  • Start date Start date
G

Giuseppe R.

Hi to all,
problem: several hundreds of compressed files (.zip stored in a tree
structure under the file system) to be unzipped.
I would avoid to manually do the works, is it possible to invoke unzip tool
included in WinXp by command line?
If Yes, how?

I also could consider to turn to another sw (free) supporting that feature
Thanks in advance,
G.R.
 
David Candy posted the basic script function over in windowsxp.general
several months ago

Set objShell = CreateObject("Shell.Application")
Set SrcFldr=objShell.NameSpace("c:\myzip.zip")
Set DestObj=objShell.NameSpace("c:\")
Set FldrItems=SrcFldr.Items
DestObj.CopyHere FldrItems, &H214

see:
CopyHere:
http://msdn.microsoft.com/library/d...shell/reference/objects/shell/application.asp


Creating a script to itterate through the argument of a set of dropped files
would be easy enough, but the exact syntax would depend on where you wanted
them put, etc.
 
--drop_zips_on_me.js--cut here--
function GetDetails()
{ var objShell = new ActiveXObject("Shell.Application");
var Ag = WScript.Arguments;
var objFolder = new Object;
for(j=0; j<Ag.length; j++)
{
objFolder = objShell.NameSpace(Ag(j));
if (objFolder != null)
{
var objFolderItems;
objFolderItems = objFolder.Items();
if (objFolderItems != null)
{
var objFolderItem;
var s ="";
for(i=0; i<objFolderItems.Count; i++)
{
objFolderItem = objFolderItems.Item(i);
s+=objFolderItem.Name + " ";
}
}
}
WScript.Echo(s);
}

}
GetDetails();
--cut here--
Highlight a few zips, and drop them on this to see the contents
 

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

Back
Top