0

I need to Compress/Zip an xls file which is generated by my macro. I have IZarc installed on my machine.

Can somebody please suggest the batch code to zip an xlx file?

Infinite Recursion
  • 6,511
  • 28
  • 39
  • 51
user3134531
  • 1
  • 1
  • 2
  • possible duplicate of [How can you zip or unzip from the command prompt using ONLY Windows' built-in capabilities?](http://stackoverflow.com/questions/17546016/how-can-you-zip-or-unzip-from-the-command-prompt-using-only-windows-built-in-ca) – user93353 Dec 26 '13 at 14:05

2 Answers2

0

This is copy-pasted from this link.

@ECHO OFF

REM Replace space in hour with zero if it's less than 10
SET hr=%time:~0,2%
IF %hr% lss 10 SET hr=0%hr:~1,1%

REM This sets the date like this:  mm-dd-yr-hrminsecs1/100secs
Set TODAY=%date:~4,2%-%date:~7,2%-%date:~10,4%-%hr%%time:~3,2%%time:~6,2%%time:~9,2%

REM Use IZArc to Zip files in folder c:\testzip and place the zip archive in C:\testmove

ECHO.
ECHO Zipping all files in C:\testzip and moving archive to c:\testmove
ECHO.
izarcc -a -cx "C:\testmove\xxxx_%TODAY%.zip" "C:\testzip\*.*"
ECHO.

ECHO Delete the files in orginal folder
DEL "C:\testzip\*.*"

PAUSE

For completeness, this script looks good without any cuts.

Siva Tumma
  • 1,695
  • 12
  • 23
0

this utility might be something for you

https://mega.nz/#!4VZnFb6T!nqv0JTqJYLff7e44WQS6-VvhAU-Cs7WBnHZXFd9FRWc

inside there will be 2 .exe files. one for zipping and one for un-zipping. there will also be an .txt file tells you how to use it

virus-total scan https://www.virustotal.com/da/file/5a38d605e943a1f5ce185e19eb9bda0969d370e7aad9a03575fab7852ed48157/analysis/1488190750/

EXAMPLE OF USAGE:

Zip Files

@echo off
title Zip files in folder
zip.exe zippedxlxfiles path/to/xlxfiles/*.*
pause

Zip a single file

@echo off
title Zip files in folder
zip.exe zippedxlxfiles path/to/xlxfiles/filename.xlx
pause

Note this will zip all the files in the folder you choose

Un-zip Files

@echo off
title Zip files in folder
unzip.exe zippedxlxfiles
pause

Note that this will unzip the files in the same directory as the exe itself