218Views8Replies

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?

Comments

The forums are retiring in 2021 and are now closed for new topics and comments.
0
RONITMAHIPAL
RONITMAHIPAL

1 year ago

you can map and then can use below given command through bat file
7z a -ppassword -t7z TBK.zIP *.txt -r

0
computerguy
computerguy

13 years ago

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!!

0
NachoMahma
NachoMahma

Reply 13 years ago

. 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"
0
NachoMahma
NachoMahma

Reply 13 years ago

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

0
NachoMahma
NachoMahma

Reply 13 years ago

. OK. This works on my machine:
   "C:\Program Files\7-Zip\7z" a -tzip C:\ziptest.zip C:\WINDOWS\Fonts\* -r -pPassword
0
NachoMahma
NachoMahma

13 years ago

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

0
computerguy
computerguy

Reply 13 years ago

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.

0
NachoMahma
NachoMahma

Reply 13 years ago

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