Auto Compress Files Batch Snippet

Windows Batch File Snippet for zip multiple files automatically.

Requires 7zip app installed in C:\Program Files

@ECHO ON

SET SourceDir=D:\<source directories>\psd
SET DestDir=D:\<destination directories>\psd

CD /D "C:\Program Files\7-Zip"
FOR /F "TOKENS=*" %%F IN ('DIR /B /A-D "%SourceDir%"') DO (
    7z.exe a -mx9 "%DestDir%\%%~NF.zip" "%SourceDir%\%%~NXF"
)
EXIT