Context Menu Problem

Support for xplorer² free lite version

Moderators: fgagnon, nikos, Site Mods

User avatar
AEN007
Member
Member
Posts: 45
Joined: 2008 May 04, 23:17

Context Menu Problem

Post by AEN007 »

17April2010

Greetings.
I would like to resolve an x²Lite context menu (CM) problem.

The following CM commands work in both 2xEx & x²Lite»

Code: Select all

"C:\Program Files\AVapps\Port\wavpak\wvunpack.exe" "%1"
C:\Program Files\AVapps\Port\wavpak\wavpack.exe -hhx %1
These use the %1 variable and only tell WavPack to un/pack 1 file -
the file that is highlighted/selected in 2xEx or x²Lite.

The following CM wildcard "batch" commands work in 2xEx NOT x²Lite»

Code: Select all

C:\Program Files\AVapps\Port\wavpak\wavpack.exe *.wav
C:\Program Files\AVapps\Port\wavpak\wvunpack.exe *.wv
It seems that 2xEx passes the directory location
of the wildcard variable files to the wavpack exe but that x² does NOT.

I would like to find a way to run the wildcard batch CM commands
in x² as well as 2xEx.

Any helpful replies/insights appreciated.
Thank you.
Regards,
AEN
Æ
User avatar
nikos
Site Admin
Site Admin
Posts: 16296
Joined: 2002 Feb 07, 15:57
Location: UK

Post by nikos »

how do you run the commands, from the addressbar?
User avatar
AEN007
Member
Member
Posts: 45
Joined: 2008 May 04, 23:17

Post by AEN007 »

19April2010

Greetings.
Thanks for the reply.

These commands are (custom) "shell commands".
I highlight the file(s) to un/pack, hit the AppsKey -
which opens the context menu.
The first level of the context menu has "keyboard mnemonics",
so I can hit the single "hot&key" to execute the desired command.
(I (still) wish context menu submenus in x² had "keyboard mnemonics" -
like XP WinExplorer does ...)

I would like to find a way to run the wildcard batch CM commands
in x² as well as 2xEx.

Any helpful replies/insights appreciated.
Thank you.
Regards,
AEN
Æ
Kilmatead
Platinum Member
Platinum Member
Posts: 4797
Joined: 2008 Sep 30, 06:52
Location: Baile Átha Cliath

Post by Kilmatead »

AEN007 wrote:Any helpful replies/insights appreciated.
Relevant Disclaimers: We'll file this post under "Curious Insights"... as to how helpful it is, I'll leave that to your own sense of posterity. :wink:

Not using "wavpack", I decided to do my own experiments using Gimp and PNG's... I don't think the difference in application is relevant, as I tried the experiments again using TXT files and an editor, and the results were the same.

First off, it should be pointed out that trying to do so-called wildcard *.* batch operations invoked via a context menu call without explicit pathnames is a bad idea.  The wildcard isn't parsed under x2, it's passed to the application as a literal string - in other words, the text editor kept trying to open/create a files named "...\*.TXT" and Gimp "...\*.PNG" - obviously resulting in filename errors.  Curiously the path (if unspecified) defaults (in a fresh x2 process) to whatever the last "successful" directory access was... sometimes this was the x2 home folder (C:Program Files\zabkat\), sometimes it was the test folder... no real rhyme or reason to it, so I gave up trying to identify the source; there was no consistency.

Windows explorer, incidentally, did parse these things out, but rather kept opening multiple processes of the application rather than one instance with multiple tabs.  Again, this had consistency problems as well, dependant upon the application.  Not reliable.

So I took another approach.

I created a script (VBS) for the following:

Code: Select all

Set filesys = CreateObject("Scripting.FileSystemObject")

path = filesys.GetParentFolderName(Wscript.Arguments(0))

command = chr(34) &  "C:\Program Files (x86)\GIMP-2.0\bin\gimp-2.6.exe"  & chr(34) & chr(32) & chr(34) & path & "\*.png" & chr(34)

set objShell = createobject("Wscript.Shell")
   objShell.Run command, 1, 0
The contents of the "command" string become the application path in literal quotes (chr 34), with the parent-folder + wildcard also in literal quotes separated by a space (chr 32).

Basically, this derives the parent folder of any selected file and opens the application from within the script with the "*.png" explicitly called to that folder.  In other words, instead of passing "*.PNG" as an "assumed" path, it forces the call as "{Parent Folder}\*.PNG" - this resulted in the desired behaviour every time.  This script is referred in the menu caption as "Batch png" via the context registry (HKCR\...\shell\Batchpng\command) as its own entry being:

Code: Select all

"C:\Windows\System32\wscript.exe" "C:\png_batch.vbs" "%1"
The %1 in this regard is only used to derive the parent folder and path, the literal selected item itself is disregarded.

So, what did I learn?
  • A) This is stupid.

    B) It's much easier to use x2 Professional with User Commands and a toolbar button.
    • See '> "wavpack.exe $P\*.wav"'
    C) Cigarettes don't help mitigate the fact that this is really really stupid.

    D) See A and C again, and contemplate B. :D
If you insist upon trying this in x2 without User Commands (as I suppose the Lite-version forces you to do), you can modify the above script for your own purposes and see what happens.  I don't know how you reference your context menu batch commands in the registry - whether they're tied to just .WAV files, or whether you linked them to the context menus for folders as well (which would make sense, given what you're trying to achieve).  If the latter, then you'll need to modify the script to derive the path from both selected files and/or folders, to get a seamless result.  (I only set it up for files as differentiating filesystem objects in VBS per type gave me a headache.  And keep in mind that the script makes no checks or assurances that a file is actually selected, which is required to glean the parentfolder.)

I did say at the beginning that how "helpful" this might be is up to yourself to determine, but those are my "insights".

Now, there's Snooker on the telly, and I officially eschew messing around with context menus for the rest of the evening. :wink:
User avatar
AEN007
Member
Member
Posts: 45
Joined: 2008 May 04, 23:17

Post by AEN007 »

22April2010

Great sales pitch for x²Pro!
You must be intimately familiar with stupidity...
Kilmatead
Platinum Member
Platinum Member
Posts: 4797
Joined: 2008 Sep 30, 06:52
Location: Baile Átha Cliath

Post by Kilmatead »

AEN007 wrote:You must be intimately familiar with stupidity...
I consider Stupidity to be more of a familiar daughter who just won't be married off again after being made a dowager by Masochism.  I knew it wasn't a good match to begin with, but what could I do when her innocent eyes met his spiteful ones across the room?  Never trust a son-in-law with scars and tattoos like those - she, of course, was naive enough to think she could name their children Hope and Charity (as all daughters do), but unsurprisingly, the sons and daughters of Masochism are actually Entropy and Myopia.

So, she (Stupidity) is always around, under foot, growing more gaunt each day from the stress of her progeny.

Such marriages always end with sadness, and it is the father-of-the-bride who ultimately pays for her sins, even though she gets it all from her mother's side of the family - alas, who were the parents of Stupidity?

My name is Desperation and I married the lithsome Wanton.  We never accomplished much in our long lives, but boy we had a good time while everyone else wasted their time living up to their responsibilities.

So, yeah, I know Stupidity.  I love her to bits, despite her poor choices, as all fathers should. :roll:

The grandchildren are hell, though - there's nothing worse than Entropy and Myopia playing with Grandad's shotgun collection.  Holidays get messy.

:D
User avatar
nikos
Site Admin
Site Admin
Posts: 16296
Joined: 2002 Feb 07, 15:57
Location: UK

Post by nikos »

AEN007 you have a serious attitude problem  :x
people are trying to help you and you are calling them names?

don't bother posting here again because you will not get any support whatsoever
P72
New Member
Posts: 6
Joined: 2009 Jul 13, 16:38

Post by P72 »

That was brilliant, Kilmatead :)

And for that I feel tempted to thank AEN007 and his attitude...
Kilmatead
Platinum Member
Platinum Member
Posts: 4797
Joined: 2008 Sep 30, 06:52
Location: Baile Átha Cliath

Post by Kilmatead »

@P72 - Just poor attempt at a little loose riffing on C.S. Lewis' Allegory of Love, for those with a taste for medieval moral cosmology.  I guess Æ's not a fan of snooker. :shrug:
User avatar
AEN007
Member
Member
Posts: 45
Joined: 2008 May 04, 23:17

Post by AEN007 »

6July2010

Greetings.
nikos wrote:AEN007 you have a serious attitude problem  :x
people are trying to help you and you are calling them names?

don't bother posting here again because you will not get any support whatsoever
Not that it matters but for the record I did not call anyone a name ...
not anymore than Buckethead did in the Buckethead's post.
Some people can't/won't get the facts straight.

I'll never get any support ... oh boo hoo hoo ...
I'll use your (great) free software forever and never buy x²Pro ...
There are also freeware sites that will notify me of new x² releases ...

By the way ... I found a workaround/solution ...
a nice piece of freeware called Open++.
It even has "keyboard mnemonics" (which x² does not)
and will execute the wildcard CM commands (which x² will not)
So I dumped the OpenExpert freeware I used the last few years
instead of the XP Open Wit&h ...
Kilmatead
Platinum Member
Platinum Member
Posts: 4797
Joined: 2008 Sep 30, 06:52
Location: Baile Átha Cliath

Post by Kilmatead »

Buckethead?  Me?  Back when I was young I used to experiment with different hair-styles, and so would occasionally be called Jarhead or Bowlhead from time to time, but never a bucket. :shrug: :D

As you seem to consider freeware a "right", there are other filemanagers which are fully free and might be more suitable for your tastes/suggestions in the long run.  Personally, the "greyed out" bits of x2 lite drove me nuts, so I just gave up and bought it, but that's just me.

I do agree though, Open++ is a more reasonable work-around than my "Buckethead post", except it's not as much fun as manipulating the Context Menu directly (which is what you were originally trying to do), especially seeing as it adds its own submenu clutter.

Guess I need another haircut...