Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

BATCH 7z archive decompression

SMAGALLA
2012-05-30
2012-12-07
  • SMAGALLA
    SMAGALLA
    2012-05-30

    Hi all,

    I create a cmd that allows me to retrieve log in HTML email mailing them go.
    There are several html files, so I wanted to compress all files with the 7Z then I send email with BLAT.
    Sending works fine, but I can not unzip the file compress, 7Z an error: Can not open the archive.

    Here is my cmd to send:

    @ECHO OFF
    CLS
    SET datetimef=%date:~-4%_%date:~3,2%_%date:~0,2%
    SET expediteur=adresseemail@domain.fr
    SET eMail=destinataire@domain.fr
    SET subj=-s "Log HTML"
    SET msg=Ci-joint les rapports de supervisions
    7z.exe a -tzip -mm=Deflate -mx7 -md=32k -mfb=64 -mpass=3 -mem=AES256 "Log_HTML.7z" "*.html"
    ::::::::::::::::: Now we run Blat!  :::::::::::::::::
    blat %0 -to %eMail% -f %expediteur% %subj% -attacht "Log_HTML.7z"
    ::::::::::: A quick message to the screen :::::::::::
    ECHO.
    ECHO ErrorLevel returned from Blat == %ERRORLEVEL% echo.
    COPY "Log_HTML.7z" "SAV_LOG\%datetimef%.7z" /V /Y
    EXIT
    

    What is the command to decompress?

    Thanks

     
  • fernando
    fernando
    2012-05-30

    you use -tzip but you name file with Log_HTML.7z
    you do not need -mm=Deflate because Deflate is default for Zip
    you do not need -md=32k because that is for -mm=BZip2
    where is the -pPASSWORD switch for -mem=AES256?

    try compress…
    7z a -mx7 -mfb=64 -mpass=3 -mem=AES256 -pPASSWORD "Log_HTML.zip" "*.html"

    try decompress…
    7z e -pPASSWORD "Log_HTML.zip"

    for blat…
    you want to attach a binary file: -attach "Log_HTML.zip"; -attacht is for a Text file
    %msg% is not in blat command line
    what is purpose of %0?

    try…
    blat -body "%msg" -to %eMail% -f %expediteur% %subj% -attach "Log_HTML.7z"

    you may want to change SET subj=-s "Log HTML" to SET subj=Log HTML
    (more consistent with other variables and blat command line parameters)
    and try…
    blat -body "%msg" -to %eMail% -f %expediteur% -s "%subj%" -attach "Log_HTML.7z"

     
  • SMAGALLA
    SMAGALLA
    2012-05-31

    Hello,
    Thank you for responding so quickly!
    Actually, it works better with the right parameters!

    Thank you !!!