Page 1 of 1

using .bat to search the folder and compres files into zip.

Posted: 13 Jan 2009 07:32
by KillerBueno
hi there!
I'm just wondering is it possible, that a simple MS-DOS Batch file could find files and compres them into zip? I have a network drive, and the pictures are in one place, separated in subfolders named for example 2006, 2007... could you help or give me some useful tips? :)

Thanks,
Adrian N.

Posted: 13 Jan 2009 15:59
by Cander
Yes, this should be possible to do with a pretty simple batch file. Not an expert on this parts, but I know that you can zip and unzip from cmd, so there shouldn't be problems doing this.

Posted: 23 Jan 2009 12:33
by KillerBueno
maybie you could post how to do a batch file like this, please?

Posted: 03 Feb 2009 14:17
by songkok
i will post the batch file tomorrow. just one question, what kind of zip you use? 7zip or winzip?

Posted: 05 Feb 2009 11:08
by venom
here are a couple methods i use

winrar
START /belownormal /wait /min /D"C:\Program Files\WinRAR" winrar a -ep -afzip "C:\path\to\output_file.zip" "C:\path\to\the\directory\you\want\to\zip"

7-zip
START /belownormal /wait /D"C:\Program Files\7-Zip\" 7z.exe a -tzip -r -mx5 "C:\path\to\output_file.zip" "C:\path\to\the\directory\you\want\to\zip"

Known

Posted: 11 Feb 2009 07:18
by spam_killer
If you want to know all related command, just open Winrar then goto help and find there..

Thanks

Re: using .bat to search the folder and compres files into z

Posted: 07 Aug 2010 09:32
by santhosh
thanks

its zipping a file .........but can i zip a folder........using this same command

Re: using .bat to search the folder and compres files into z

Posted: 07 Aug 2010 23:05
by !k
santhosh, both this commands zip a folder

Note:
START /belownormal /wait /min /D"C:\Program Files\WinRAR" winrar a -ep1 -afzip "C:\path\to\output_file.zip" "C:\path\to\the\directory\you\want\to\zip"

Re: using .bat to search the folder and compres files into z

Posted: 08 Aug 2010 11:17
by santhosh
!k thnks,

but again i am facing same problem, its zipping only files inside that folder...not the folder.

example:
i have a folder name sat,inside this i got sub folders and files.
now i want to zip this sat folder.


when i tried its zipping all the files but not the folder.


kindly help me out what changes should i do.

Re: using .bat to search the folder and compres files into z

Posted: 08 Aug 2010 11:21
by santhosh
one more example....if that sat folder doesn't have any file, when i run the script it shows error " no files is add to zip".
but it should zip that folder right...how to do it.

Re: using .bat to search the folder and compres files into z

Posted: 08 Aug 2010 11:46
by !k
START /belownormal /wait /D"C:\Program Files\7-Zip\" 7z.exe a -tzip -r- -mx5 "C:\path\to\output_file.zip" "C:\path\to\the\directory\you\want\to\zip\*.*"
santhosh, read the help on the command line of archiver

Re: using .bat to search the folder and compres files into z

Posted: 09 Aug 2010 15:24
by santhosh
Thanks !k

i found it

START /belownormal /wait /min /D"C:\Program Files\WinRAR" winrar a -rr -r -ep1 -afzip "C:\Documents and Settings\Pretups2

\dat.rar" "C:\Documents and Settings\Pretups2\sat"