Sign in to follow this  
Followers 0
bobheart

zip

9 posts in this topic

I have 7z zip and trying to zip a folder with the command line but i can't seem to zip the folder ?

7za.exe a -tzip Profiles.zip Profiles

That would be a bat file as I know them better but I would like to do it in au3 if I can ?

How do you zip the folder and all folders under it with the files ?

From the help file .

a (Add) command

Adds files to archive.

Examples

7z a -tzip archive.zip subdir\*

adds all files from directory subdir to archive archive.zip.

7z a -tzip Files.zip "Program files\*" -r

adds all files from directory Program to archive Files.zip.

Switches that can be used with this command

-i (Include), -m (Method), -p (Set Password), -r (Recurse), -t (Type of archive), -u (Update), -w (Working Dir), -x (Exclude),

Share this post


Link to post
Share on other sites



assuming that the executable is in the current folder or path:

Run(@comspec " /c 7za.exe a -tzip Profiles.zip Profiles")

should work.


"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Not sure what this is ?

---------------------------

AutoIt Error

---------------------------

Line 1  (File "E:\programs1\zip.au3"):

Run(@comspec " /c 7za.exe a -tzip Profiles.zip Profiles")

Run(^ ERROR

Error: Error in expression.

---------------------------

OK 

---------------------------

Edited by bobheart

Share this post


Link to post
Share on other sites

Not sure what this is ?

<{POST_SNAPBACK}>

just add an & between @comspec and " :ph34r:

Run(@comspec & " /c 7za.exe a -tzip Profiles.zip Profiles")

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

It makes the zip file but nothing in it . it was doing the samething to me when I started trying it .

Share this post


Link to post
Share on other sites

here is the zip .

Share this post


Link to post
Share on other sites

It makes the zip file but nothing in it . it was doing the samething to me  when I started  trying it .

<{POST_SNAPBACK}>

bob, change the source to the poper full path...

Run(@comspec & " /c 7za.exe a -tzip Profiles.zip c:\?????\Profiles")

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

How would I do @ScriptDir ? I don't know where it will end up at .

Share this post


Link to post
Share on other sites

just add an & between @comspec and "  :ph34r:

Run(@comspec & " /c 7za.exe a -tzip Profiles.zip Profiles")

<{POST_SNAPBACK}>

whoops, my bad...

How would I do @ScriptDir ? I don't know where it will end up at .

<{POST_SNAPBACK}>

Bob, thought you'd have this down by now...

Run(@comspec & " /c 7za.exe a -tzip Profiles.zip " & @scriptdir & "\Profiles")

"I'm not even supposed to be here today!" -Dante (Hicks)

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