Page 1 of 1

UDC from shell context menu

Posted: 26 Oct 2008 17:49
by ivan
I am interesting if it is possible to make a UDC out of any command that's available from shell context menu.

Example:

I have a series of sequentially numbered parts of an archive that, when extracted, creates one big file. If WinRAR is integrated into shell, it provides 3 commands when right-clicking on an archive:
1. "Extract files..."
2. "Extract Here"
3. "Extract to folder" where folder = <curitem> (without the part number and rar extension)

So, if you have a list of files like this:
temp.part1.rar
temp.part2.rar
temp.part3.rar
...and so on
then selecting option 3 when right-clicking will extract the contents of those parts to a folder called "temp". I'd like to create a UDC that will achieve exactly that.

Doing so:

Code: Select all

Set($cf,<curfolder>);
OpenWith("""C:\program files\winrar\winrar.exe"" x -- *.rar * $cf", "s");
isn't effective because there is no guarantee that the full path (aka folder) is present in RARs.

On the other hand, doing this:

Code: Select all

Set($ci,<curitem>);
OpenWith("""C:\program files\winrar\winrar.exe"" e -- *.rar * $ci", "s");
is no good either because that will grab the full name of the file instead of only the relevant part. In other words, there is no way to exclude a set number of chars from <curitem>.

A solution could be to automatically add shell-integrated commands to list of functions or to enable us to be able to remove a set number of chars from beginning/end of custom variables.

Re: UDC from shell context menu

Posted: 26 Oct 2008 18:29
by jacky
Aren't you just looking for this?

Code: Select all

"WinRAR" x -ad -- <items>
And no, there is no command ID for what's found in the shell context menu, since they're not available on CKS.

Re: UDC from shell context menu

Posted: 26 Oct 2008 18:54
by ivan
Using this:

Code: Select all

"Extract to Separate folder" 
 OpenWith("""C:\program files\winrar\winrar.exe"" x -ad -- <items>, "s");
throws a "Failed to Open" error.
jacky wrote:And no, there is no command ID for what's found in the shell context menu, since they're not available on CKS.
some commands in shell context menu do have respective functions (delete, app-specific OpenWith options, open, rename, properties, cut, copy, paste, etc...) in the list, so attaching numbers to others shouldn't be out of the question.[/quote]

Re: UDC from shell context menu

Posted: 26 Oct 2008 19:41
by jacky
ivan wrote:

Code: Select all

"Extract to Separate folder" 
 OpenWith("""C:\program files\winrar\winrar.exe"" x -ad -- <items>, "s");
I think it should be used on multiple instance mode...
ivan wrote:some commands in shell context menu do have respective functions (delete, app-specific OpenWith options, open, rename, properties, cut, copy, paste, etc...) in the list, so attaching numbers to others shouldn't be out of the question.
Yes it is, because those aren't the same commands at all, and those shell ext commands can come & go or differ according to what item(s) they relate to...
Just because XY also has Cut/Copy/Delete/etc doesn't mean those are the same commands, no.

Re: UDC from shell context menu

Posted: 26 Oct 2008 19:54
by ivan
jacky wrote:I think it should be used on multiple instance mode...
Doesn't do the trick...
jacky wrote:Yes it is, because those aren't the same commands at all, and those shell ext commands can come & go or differ according to what item(s) they relate to...
Just because XY also has Cut/Copy/Delete/etc doesn't mean those are the same commands, no.
But a list of those commands is available (in the registry I guess), so it's not like it's impossible to fish them out and append for changes.

Re: UDC from shell context menu

Posted: 26 Oct 2008 20:35
by jacky
You forgot to close your quotes....

Code: Select all

"Extract to Separate folder" 
 OpenWith("""C:\program files\winrar\winrar.exe"" x -ad -- <items>", "m");

Re: UDC from shell context menu

Posted: 26 Oct 2008 20:44
by ivan
jacky wrote:You forgot to close your quotes....
Ah yes, those pesky quotes :P If only XY could check on-the-fly for that (like Eclipse IDE does) then it would be super.

P.S. It still a nice proposition to be able to play around with custom variables if they are derived.