Jump to content

Syntax help for zipping up contents of a folder?


Recommended Posts

I just did an extensive search of the forums for various key words that might help in zipping up a folder's contents and saving to a target location.

I also looked extensively through the help file and codes _are_ there, just not the environment that they're dealt with.

Does anyone know of a location of various backup style of AI scripts so that I can study them and figure out how to use the syntax for my own needs?

To give an overview, I need to zip up the contents of my journal program's data files:

C:\Program Files\DIARY\Diary v2.2\DATA\*.*

and save to this folder:

D:\0- PROGRAMS\Diary v2.2\BACKUPS

using this type of naming convention:

Diary2.2 BKP- 2004.07.05.Mn.zip

(i.e., putting in the current date. The example here is for today, only.)

Thanks! Any help appreciated pointing me in the right direction.

Cheers.

Link to post
Share on other sites

I just did an extensive search of the forums for various key words that might help in zipping up a folder's contents and saving to a target location.

I also looked extensively through the help file and codes _are_ there, just not the environment that they're dealt with.

Does anyone know of a location of various backup style of AI scripts so that I can study them and figure out how to use the syntax for my own needs?

To give an overview, I need to zip up the contents of my journal program's data files:

C:\Program Files\DIARY\Diary v2.2\DATA\*.*

and save to this folder:

D:\0-    PROGRAMS\Diary v2.2\BACKUPS

using this type of naming convention:

Diary2.2 BKP- 2004.07.05.Mn.zip

(i.e., putting in the current date.  The example here is for today, only.)

Thanks!  Any help appreciated pointing me in the right direction.

Cheers.

You can download a command line version of PowerArchiver on PowerArchiver.com.

This is an example of how to zip files from "My Documents" to your desktop.

RunWait(@ComSpec & ' /c PACOMP.EXE -a -r -p -c2 -w -q "' & @DesktopDir & '"\MyDocuments.zip "' & @MyDocumentsDir & '"\*.*')
Link to post
Share on other sites

The WinZip command line support add-in for WinZip will handle this requirement too. It's a free download for WinZip version 9 owners at this web site: http://www.winzip.com/downcl.htm. I have used it extensively and it works extremely well. It's fast too. The syntax for it's use is similar to that of PowerArchiver.

Computers don't solve problems, they just rearrange them.New string TRIM() functions for AutoIt3

Link to post
Share on other sites

Thanks for the replies, much appreciated.

I use WinRAR and it has a command line RAR.EXE included in the installation, I've been able to determine.

I HATE command line stuff, though <sigh>. Anyway, that part is my problem to figure out and Ive just spent a frustrating few sessions trying to do that <lol>.

Anyway, one thing is certain, I'd prefer to use AI to a batch file approach to launch this. Has anyone seen an AI script that uses a command line archiving program approach? I could then substitute the WinRAR syntax (once I can get the darned bugs ironed out <g>) for the archive part.

Thanks.

Link to post
Share on other sites

I am working the same sort of project. I cannot get rar.exe to work however. This is my code...

RunWait(@ComSpec & " /c " & '"c:\program files\winrar\rar.exe" a "c:\_autoit scripts\backuputil\test.rar" "@c:\_autoit scripts\backuputil\rarfiles.lst"')

If I open up a prompt and run

"c:\program files\winrar\rar.exe" a "c:\_autoit scripts\backuputil\test.rar" "@c:\_autoit scripts\backuputil\rarfiles.lst"

everything works fine. Anyone see a problem?

Link to post
Share on other sites

@All

Thanks for all the help. I was playing around and found that the following code works

RunWait('"c:\program files\winrar\rar.exe" a "c:\_autoit scripts\backuputil\test.rar" "@c:\_autoit scripts\backuputil\rarfiles.lst"')

Thanks for all the help

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...