Thanks for your help. I'm not quite there yet but I'm a bit closer.
Your script as written didn't work; I kept getting an error saying it
couldn't find 
?"C:\Program Files\WinRAR\WinRAR.exe a -r D:\work\"++DirValue

I tried changing all the quotes around and the closest I could get was
this:
"C:/Program Files/WinRAR/WinRAR.exe" a -r "D:/work/"++DirValue
It didn't like the back slashs, even with the "?" before both
directories. The problem is that it always compresses my Winrar
directory instead of the one I am right clicking on. Secondly, the
name of the archive comes out to "++DirValue.rar"

--- In [email protected], "Gardner, Paul G." <[EMAIL PROTECTED]>
wrote:
> >Winrar gives me the following error message:
> >"Can not create ?"D:\work\|D:\download.rar"
> >I was trying to backup D:\download into an archive named 
> >Download.rar in the D:\work directory.
> >
> >One obvious error is that "||" is passing the entire path instead
of 
> >just the folder name. Can I change that? Secondly, why is there an 
> >extra "|" before the filename? Thanks in advance for any help you 
> >can offer
> 
> I don't use WinRar, so the below is not completely tested:
> 
> I'm not aware of a way to natively get only the current directory
name, so I
> scripted a quick one.  Of course, if there is a plugin or native
method to
> get the current directory, then all this is for naught.  But I
couldn't find
> on in the help, or plugin documentation.  
> 
> Save the below script in a file (in the PowerPro\scripts directory)
call it
> from your command line.  For example, I called it
> 'backupdirectory.powerpro', put the file into my PowerPro\Scripts
directory,
> and in my ContextFolder command, I put '.backupdirectory("|")' <-
without
> the single quotes.
> 
> The last statement looks fine to me when I view it in the PowerPro
debug
> window, but I'm not able to run it, so you may need to play with the
syntax
> (incl. removing the ?) to get it to call WinRar correctly.
> 
> As far as the appearance of the "|" in your error message - it looks
like a
> parser error to me.  When I changed your statement from 
>    "C:\Program Files\WinRAR\WinRAR.exe" a -r ?"D:\work\||"  
> to 
>       "C:\Program Files\WinRAR\WinRAR.exe" a -r ?"D:\work\"++"||" 
> the extra pipe disappeared when I printed out the resulting line in
the
> debug window.
> 
> I also assumed that you would want to backup the directory you were
> right-clicking on.  If that was incorrect and you want to backup
that
> directory's parent directory, then change the script call from 
>    .backupdirectory("|")
> to
>    .backupdirectory(file.folder(?"||"))
> 
> 
> ;----begin script-----
> local DirValue
> 
> For (DirValue = arg(1); index(DirValue, ?"\") > 0; )
>   DirValue = remove(DirValue,index(DirValue, ?"\"))
> Endfor
> 
> ?"C:\Program Files\WinRAR\WinRAR.exe a -r D:\work\"++DirValue
> ;----end script-----
> 
> HTH
> Paul




Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to