Skip to content

Instantly share code, notes, and snippets.

@rumbu
Last active June 12, 2023 03:13
Show Gist options
  • Save rumbu/06e4bdc6a466af0aa010ab3934c3ea51 to your computer and use it in GitHub Desktop.
Save rumbu/06e4bdc6a466af0aa010ab3934c3ea51 to your computer and use it in GitHub Desktop.
7-zip AES encryption from the command line
# Compress and encrypt all current subfolders on Windows
FOR /D %%X IN (*) DO "C:\Program Files\7-Zip\7z.exe" a -mhe -pMYPASSWORD "%%X.7z" "%%X"
# To compress and encrypt the whole directory, excluding subfolders, the password will be asked
7z a -mhe -p archive.7z source-directory/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment