Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Desktop.ini

Help
sevalav
2013-05-12
2013-05-12
  • sevalav
    sevalav
    2013-05-12

    Hello,
    I am using batch file to zipped plain xml file. I am calling this .bat file from Basic (Calc, ApacheOpenOffice). But, in zipped folder is also file "desktop.ini". This is a problem, because I must send zipped folder only with zipped xml file, without any other files. Is it possible to manage this, that program not create this "desktop.ini" file, or somehow to delete this file with batch file? I have on my computer windows 7 (x64),7-zip 9.2, 7az command line. Here is the code from batch file.

    @ECHO OFF

    REM Replace space in hour with zero if it's less than 10
    SET hr=%time:~0,2%
    IF %hr% lss 10 SET hr=0%hr:~1,1%

    REM This sets the date like this: mm-dd-yr-hrminsecs1/100secs
    Set TODAY=%date:~4,2%-%date:~7,2%-%date:~10,4%-%hr%%time:~3,2%%time:~6,2%%time:~9,2%

    REM Use 7az to Zip files in folder D:\testzip and place the zip archive in D:\testmove

    ECHO.
    ECHO Zipping all files in D:\testzip and moving archive to D:\testmove
    ECHO.
    "C:\Users\Optika Stevanovic\Documents\7za920\7za.exe" a -tzip "D:\testmove\xxxx_%TODAY%.zip" "D:\testzip*.*" -mx5
    ECHO.

    rem ECHO Delete the files in orginal folder
    rem DEL "D:\testzip*.*"

    STOP

     
  • fernando
    fernando
    2013-05-12

    try like...

      7za.exe a "D:\testmove\xxxx_%TODAY%.zip" "D:\testzip\*" -xr0!*desktop.ini
    
     redundancies...
     -tzip = 7-Zip will create archive type of archive filename extension
     -mx5 = default compression of type Zip
     *.* = read help subject 'syntax' about wildcard use
    
     
  • sevalav
    sevalav
    2013-05-12

    Thanks, it's working!