Jump to content

Zipping folders!


Guest richw
 Share

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?

:)

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...