152Views8Replies

Author Options:

Batch file zip Answered

I need a batch file that will zip up text file with a password that resides on a network drive. Can some one help me with this?

8 Replies

user
computerguy (author)2008-04-03

After a few hours of trying I still didn't get very far. Can someone post some code that would use 7zip that in a Batch file would zip up a file called testzip? C:\ziptest and apply a password of jj2154 to it. Thanks!!

Select as Best AnswerUndo Best Answer

user
NachoMahma (author)computerguy2008-04-04
. Try:
  7z a -tzip C:\ziptest.zip C:\WINDOWS\Fonts\* -r -pPassword
. Change "C:\WINDOWS\Fonts\*" to point to the directory you want to ZIP and Password to whatever you want.
. 7z - invokes the program
. a - add files
. -tzip - use ZIP format
. C:\testzip.zip - name of destination file
. C:\WINDOWS\Fonts\* - files to compress (your fonts, in this case)
. -r - recurse subdirectories (not needed if there are no subdirs or you don't want to compress them)
. -pPassword - sets password to "Password"

Select as Best AnswerUndo Best Answer

user
NachoMahma (author)NachoMahma2008-04-04

. PS: You may need to prepend "C:\Program Files\7-Zip\" to that command, if Windows complains that it can't find the program.

Select as Best AnswerUndo Best Answer

user
NachoMahma (author)NachoMahma2008-04-04
. OK. This works on my machine:
   "C:\Program Files\7-Zip\7z" a -tzip C:\ziptest.zip C:\WINDOWS\Fonts\* -r -pPassword

Select as Best AnswerUndo Best Answer

user
NachoMahma (author)2008-04-01

. Depends on which program you are using to do the ZIPping. Refer to the documentation for your program, ie, RTFM.

Select as Best AnswerUndo Best Answer

user
computerguy (author)NachoMahma2008-04-02

The only zip program that I have on my pc is 7zip. But if you know of one that is easer to use I get it.

Select as Best AnswerUndo Best Answer

user
NachoMahma (author)computerguy2008-04-02

. Start menu:All Programs:7-Zip:7-Zip Help:Command Line Version

Select as Best AnswerUndo Best Answer