Created
December 25, 2015 09:26
-
-
Save nasitra/2618a18b63ed4f485cf6 to your computer and use it in GitHub Desktop.
Unzip .zip file in Windows
This file contains hidden or 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
| var argc = WScript.Arguments.Count(); | |
| if (argc !== 2) { | |
| WScript.Echo('unzip.js [input file] [output folder]'); | |
| WScript.Quit(1); | |
| } | |
| var objShell = new ActiveXObject("shell.application"); | |
| var inputFileName = WScript.Arguments(0); | |
| var outputFolderName = WScript.Arguments(1); | |
| var objFileSys = new ActiveXObject("Scripting.FileSystemObject"); | |
| inputFileName = objFileSys.GetAbsolutePathName(inputFileName); | |
| outputFolderName = objFileSys.GetAbsolutePathName(outputFolderName); | |
| var objInput = objShell.NameSpace(inputFileName); | |
| if (!objFileSys.FolderExists(outputFolderName)) { | |
| objFileSys.CreateFolder(outputFolderName); | |
| } | |
| var objOutput = objShell.NameSpace(outputFolderName); | |
| objOutput.CopyHere(objInput.Items(), 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment