Jump to content
Sign in to follow this  
Guest richw

Zipping folders!

Recommended Posts

Guest richw

Hi,

I've written the following code to zip up my thunderbird email directory. I'm using 7-zip command line app from www.7-zip.org

$Filename = @UserName & ".7z "
$Dir = @UserProfileDir & "\Application Data\Thunderbird\"


Run(@comspec & " /c 7za.exe a " & $Filename & $Dir)

The only problem is there is spaces in the path so I need to use the command like this:

7za.exe a richardw.7z "c:\Documents and Settings\richardw\Application Data\Thunderbird"

So is there anyway I can add the " " around $Dir variable or should I be looking at another way?

:)

Share this post


Link to post
Share on other sites
LxP

7za.exe a richardw.7z "c:\Documents and Settings\richardw\Application Data\Thunderbird"

Try this out for size (also includes a space between the filename and the directory now):

run(@comSpec & ' /c 7za.exe a "' & $filename & '" "' & $dir & '"')
Edited by LxP

Share this post


Link to post
Share on other sites
Guest richw

worked a treat, thanks :)

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  

×