Created
March 22, 2012 07:30
-
-
Save mumurik/2156853 to your computer and use it in GitHub Desktop.
release related script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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