Sign in to follow this  
Followers 0
VernV3

7-zip & RAR CmdLine

3 posts in this topic

I noticed someone else Zip plugin, A plugin to add zip function to AutoIt V3. was making a zip plugin.

I've been using 7-zip and/or rar via command line for awhile so thought I'd pass along some usage info.

7-zip (from the help file.)

===============================================

7z <command> [<switch>...] <base_archive_name> [<arguments>...]

<arguments> ::= <switch> | <wildcard> | <filename> | <list_file>

<switch>::= <switch_symbol><switch_characters>[<option>]

<switch_symbol> ::= '/' | '-'

<list_file> ::= @{filename}

===============================================

I just noticed that the help file has "7z", not "7za" like I've been using.

Anyway, an example of usage:

CODE

RunWait("7za.exe a -pPassword " & $s_ZipFileOutputFile & " " & "TestTextFile.txt", @TempDir, @SW_HIDE)

It's very basic, but it shows just how easy it can be to call a command-line tool. 7-zip is freely available and is constantly being upgraded. I use it for those reasons and for the fact that it can recurse directories automatically, encrypt the output and choose the compression and output type. If someone can build into a pure AutoIT -uncompiled- script everything that 7-zip can do, then I will definately consider moving to it.

Since I can't upload the help file here, I've copied some to here:

Commands quick reference

Command Description

a Add

b Benchmark

d Delete

e Extract

l List

t Test

u Update

x eXtract with full paths


Vern

Share this post


Link to post
Share on other sites



Since this post had been somehow posted 6 times, when I asked the moderators that only the final one be kept that request somehow got overlooked and the final one was deleted. This is only a partially completed post, but since the final one was longer and had taken me an hour to put together, I won't be expanding this post again. I rarely post here (this was only my second post) and some idiot asked me on one of the other (duplicates) postings what the point was and told me not to post 5 times...

If there is interest I will consider re-doing the expanded version again. I have better things to do than spend an hour putting a post together to have it bashed and deleted.

(I don't have the ability on this forum to edit my posts nor delete them.)


Vern

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Since this post had been somehow posted 6 times, when I asked the moderators that only the final one be kept that request somehow got overlooked and the final one was deleted. This is only a partially completed post, but since the final one was longer and had taken me an hour to put together, I won't be expanding this post again. I rarely post here (this was only my second post) and some idiot asked me on one of the other (duplicates) postings what the point was and told me not to post 5 times...

If there is interest I will consider re-doing the expanded version again. I have better things to do than spend an hour putting a post together to have it bashed and deleted.

(I don't have the ability on this forum to edit my posts nor delete them.)

It posted so many times cos the forum went wrong, I had the same on a post rather than a topic. probably the database server had a paddy, this is the sort of thing that should go in the example scripts section. You should be able to post in the examples section after 10 posts

Edited by ChrisL

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0