function unzip(zipfile,extractpath){ var fso = new ActiveXObject('Scripting.FileSystemObject'); var oShell = new ActiveXObject('Shell.Application'); var dst,zip; dst = shell.NameSpace(fso.getFolder(extractpath).Path); zip = shell.NameSpace(fso.getFile(zipfile).Path); for (var i=0; i<zip.Items().Count; i++) { try { if (fso.FileExists(zipfile)) { WSH.Stdout.Write('Unzipping ' + zip.Items().Item(i) + '... '); dst.CopyHere(zip.Items().Item(i), 4 + 16); WSH.Echo('Done.'); } } catch(e) { WSH.Echo('Failed: ' + e); } var zipfile = WSH.Arguments(0), dest = zipfile.replace(/\.\w+$/, '\\'); unzip(zipfile, dest); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)