Skip to content

Instantly share code, notes, and snippets.

@mumurik
Created March 22, 2012 07:30
Show Gist options
  • Save mumurik/2156853 to your computer and use it in GitHub Desktop.
Save mumurik/2156853 to your computer and use it in GitHub Desktop.
release related script
if (WScript.Arguments.Count() != 2) {
WScript.Echo("Usage: Cscript.exe zip.js targetfolder zipfile");
WScript.Quit();
}
var fso = new ActiveXObject("Scripting.FileSystemObject");
var shell = new ActiveXObject("Shell.Application");
var zipfile = WScript.Arguments.Item(1);
var fso = new ActiveXObject("Scripting.FileSystemObject");
var shell = new ActiveXObject("Shell.Application");
var targetZip = fso.CreateTextFile(zipfile, true);
targetZip.Write("PK" + String.fromCharCode(5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));
targetZip.Close();
WScript.Sleep(500);
var zipAsFolder = shell.NameSpace(fso.GetAbsolutePathName(zipfile));
zipAsFolder.CopyHere(fso.GetAbsolutePathName(WScript.Arguments.Item(0)));
WScript.Sleep(500);
while(true) {
WScript.Sleep(100);
try {
fso.OpenTextFile(zipfile, 8, false).Close();
break;
}
catch (e) { /* writing */ }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment