Creating a ZIP file
Has anyone created a ZIP file via scripting - or even via a batch file on Windows 10 ?
Has anyone created a ZIP file via scripting - or even via a batch file on Windows 10 ?
No, I did not get it working, even after trying all the variants I found on StackOverflow. PowerShell sounds good but is a horror when trying to call it from a batch file.
I have it working as follows:
Extend script must write two files the first is the bat file which contains the following:
PowerShell -ExecutionPolicy Bypass -File "C:\path_as_required\zipTest.ps1"
The second file is the PowerShell script which for example can be written to compress a folder or many individual files:
Compress-Archive -Path "D:\Support\CGM" -DestinationPath "D:\Support\CGMzip.zip"
This works without any annoying warnings because of the ExecutionPolicy Bypass.
I hope it works for you too!
Ian
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.