2

This thread shows the batch & VBS hybrid code used to unzip a ZIP archive file. Can a similar short batch & Jscript hybrid code be written, and how batch variables will be referenced in the Jscript block?

Would the similar batch & wsf hybrid structure be applicable like in the referenced thread, or a different approach?

<!-- : Begin batch script
@echo off
set "dir=%TEMP%\Unzip" & set "file=%USERPROFILE%\Downloads\archive.zip\"
cscript //nologo "%~f0?.wsf" "%dir%" "%file%"
exit /b

----- Begin wsf script --->
<job><script language="JScript">
Community
  • 1
  • 1
sambul35
  • 1,058
  • 14
  • 22
  • I suppose you saw [this](http://stackoverflow.com/questions/28043589/how-can-i-compress-zip-and-uncompress-unzip-files-and-folders-with-bat) – npocmaka Jul 27 '16 at 12:25
  • I did see your [script](https://github.com/npocmaka/batch.scripts/blob/master/hybrids/jscript/zipjs.bat) on Github, it looks quite comprehensive. I wonder, if a much shorter version can be derived for unzipping files similar in size to the referenced VBS hybrid to demonstrate use of common variables? – sambul35 Jul 27 '16 at 12:34
  • Another shortcoming I face with the batch & VBS hybrid is that it can't unzip files from a system folder like Downloads that was moved by a user to a different volume, as mentioned in comments [here](http://stackoverflow.com/questions/38598289/unzip-file-error-when-running-vbs-script-from-a-batch-in-windows-10). I wonder if a Jscript hybrid can be free of such limitation working with system folder symlinks? – sambul35 Jul 27 '16 at 12:36
  • for the downloads folder you can check if it is enumerated - https://technet.microsoft.com/en-us/library/ee176604.aspx - the info in the link could be outdated... – npocmaka Jul 27 '16 at 12:40
  • Sadly, the link doesn't give a Constant for the Downloads folder? I also wonder if special folders are automatically enumerated in modern OS like Win 10? – sambul35 Jul 27 '16 at 12:49
  • The example script doesn't show how to set a new path to the special FolderObject. But it should be done by the system automatically. It hints, the VBS methods might not have been updated for awhile by MS. Should it rather use system env variables instead of the constants? – sambul35 Jul 27 '16 at 13:10

0 Answers0