Menu Close

CMD Batch – WebCompress .gz

Updated On January 18, 2019
You are here:
< Back

Get the GZip binaries at http://gnuwin32.sourceforge.net/packages/gzip.htm
Create a new file WebCompress.BAT in the same folder.
Paste and save the code below.
Drag-Drop files from Windows Explorer to WebCompress.bat .

@ECHO OFF

IF "%~1"=="" GOTO misfile

:loop
IF "%1"=="" GOTO end
  ECHO %~1
  ECHO  - %~1.gz
  GZIP -c "%~1" > %~1.gz
SHIFT
GOTO loop

:misfile
ECHO Missing the parameter: Filename .
ECHO Usage: WebCompress [Filename1] [Filename2] [Filename3]
ECHO Drag-drop the files to this .BAT file.

:end
REM PAUSE > NUL

Comments are welcome.

%d bloggers like this: