Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Zip files on Windows using only what's built-in (batch script, explorer, etc)?

I am trying to write a script that I can give to user to have it automatically zip certain files and then load them onto an ftp site. Anyone know where I could find information on writing a batch file for auto-zipping files using only what is available to a user running Windows?

like image 466
James Avatar asked Nov 26 '22 19:11

James


1 Answers

It is possible to work with zip files by using the compressed folder (COM) support and Windows Scripting Host. You would start by creating the Shell.Application object. The FolderItem object has methods like CopyHere etc that will allow you to manipulate a zip file like a folder. See this page for zip and unzip sample code.

like image 118
Anders Avatar answered Dec 01 '22 00:12

Anders