Menu

Create archive from folders with date names

zuku
2016-12-12
2016-12-13
  • zuku

    zuku - 2016-12-12

    Hi,
    all my backup is created and stored with %date% folders so today backup is in folder 2016-12-12, I would create batch file to compress folder only with todays date, I have created something like this but this not work:

    FOR /D %%i IN (C:\backup\%date%) DO "c:\Program Files\7-Zip\7z.exe" a -t7z -mx=9 -sdel -x!*.7z "%%i.7z" "%%i\"

    could you help me?

     
  • AmigoJack

    AmigoJack - 2016-12-13

    "this not work" is no helpful error message and your batch issue is totally unrelated to 7z. If you want to iterate over every folder under "C:\backup\%date%" (I simply guess that - your description did not make it clear what you want) then you have to issue such a DIR likewise:

    C:\backup\%date%\*
    
     

Log in to post a comment.