%Comspec% for Internal association: *.cmd, *.bat, *.reg

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

User avatar
eugensyl
Power Member
Power Member
Posts: 564
Joined: 2004-06-03, 18:27 UTC
Location: România
Contact:

%Comspec% for Internal association: *.cmd, *.bat, *.reg

Post by *eugensyl »

Here you have my Association:

Filter3=*.cmd; *.bat; *.inf; *.vbs; *.reg
Filter3_open=*
Filter3_Open with &Notepad2=""%commander_path%\prg\notepad2.exe" "%1""
Filter3_Open with &PsPad=""%commander_path%\..\pspad\pspad.exe" "%1""
Filter3_Open with Notepad&++=""%commander_path%\..\notepad++\notepad++.exe" "%1""
Filter3_Run=%comspec% /c "%1"

The abnormal behavior is with RUN command.
First time, the file under cursor is run with current path (from active panel) and after that the path used is from opposite panel and never came back.

Try this, make test.cmd with folowing content:

[test.cmd]
dir
pause
:eof


I didn't remark this until now (TC 7.5 RC1).

Normal behavior is like command line. For example , dir is related to the active path.
My Best Wishes,

Eugen
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

I cannot reproduce this behaviour, I put a button on the buttonBar with the following:
Command: %comspec% /k dir

Always, the directory shown is whichever pane is active.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
Postkutscher
Power Member
Power Member
Posts: 556
Joined: 2006-04-01, 00:11 UTC

Post by *Postkutscher »

2eugensyl
2Balderstrom
What OS are you using?
WhACKO
Junior Member
Junior Member
Posts: 67
Joined: 2009-04-07, 11:17 UTC

Post by *WhACKO »

I had something similar, I set up an Internal association to extract rar archives and keep broken files

Code: Select all

"%COMMANDER_PATH%\..\WinRAR\rar.exe" x -kb "%1""
and it works, but it always extracts the file in the opposite panel and I can't get it to use the same path as the archive...

Maybe it would be nice to introduce %P & %T (source and target panels) for Internal Associations, just like the button bar parameters?
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

The best OS: Win2K :=)

@ WhACKO, that may be TC's Unpacking preference behaviour coming into play, when you unpack w/ TC it always defaults to the other panel. The inability to set this behaviour aside from multiple steps of deleting the "Path" in the popup confirmation among others has caused me to only unpack via the context menu.

That same thing, does work from a button:
Command: C:\Program Files\WinRAR\WinRAR.exe x -kb
Parameters: %S
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
Postkutscher
Power Member
Power Member
Posts: 556
Joined: 2006-04-01, 00:11 UTC

Post by *Postkutscher »

2Balderstrom
It seems to be, that you are not understood, eugensyl and WhACKO are talking about Internal associations, not buttons.

2eugensyl
Under Windows7 X64 an opposite panel is always used with your settings.

2WhACKO
An interesting idea ;) . I support. It could save many hotkey combinations for em_commands due to wildcard flexibility.
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Does InternalAssociation not support the same type of functionality that the "Directory Menu" does, wherein you can do both a command: and a "target path" ?

I don't use Internal Association, so I don't know.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
Postkutscher
Power Member
Power Member
Posts: 556
Joined: 2006-04-01, 00:11 UTC

Post by *Postkutscher »

2Balderstrom
If you don`t use this, you should not write that you "cannot reproduce" ;)
And no, it is not the same!
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

OK well I still can't reproduce, with Win2K.

OPEN: %Comspec% /k dir
Internally associated with .txt files, always shows the activePane's directory.
OR:

OPEN: "E:\Program Files\¤EDITors\NotePad2\Notepad2.exe" "%1"
Additional option added:
RUN: %Comspec% /k dir
RUN2: %Comspec% /k dir %1

The directory shown for both RUN options is always active pane.
Last edited by Balderstrom on 2009-08-17, 00:38 UTC, edited 1 time in total.
Postkutscher
Power Member
Power Member
Posts: 556
Joined: 2006-04-01, 00:11 UTC

Post by *Postkutscher »

Balderstrom wrote:OK well I still can't reproduce, with Win2K.

OPEN: %Comspec% /k dir
Internally associated with .txt files, always shows the activePane's directory.
Simply say, that you don`t want test orderly. What are you want to see, when loading txt-file into command shell?! Please, don`t spam the thread, if you don`t want tests correctly.
User avatar
eugensyl
Power Member
Power Member
Posts: 564
Joined: 2004-06-03, 18:27 UTC
Location: România
Contact:

Post by *eugensyl »

Postkutscher wrote:2eugensyl
2Balderstrom
What OS are you using?
XP SP3

I have tried to another computer and the behavior is the same. This occur when the same file (test.cmd) is launched several times and between runs I switch to different TC tabs.

It's seem as path focus is lose after few runs of %comspec% from internal command.

It happens ONLY when the path from opposite panel is changed and after all I return to the test.cmd folder.

Never happens with a button bar (%comspec% /c %P%N) or command line (Ctrl+ENTER, ENTER).
My Best Wishes,

Eugen
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48097
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sorry, I don't understand the problem. What does the current path matter here?
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14816
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

I can confirm the bug - just do as described in the first post - make an internal association like:

Code: Select all

FilterX=*.cmd
FilterX_open=*
FilterX_Open with &Notepad=""notepad.exe" "%1""
FilterX_Run=%comspec% /c "%1"
X depends on the number of existing associations.

Make a file: test.cmd with this content:

Code: Select all

dir
pause
:eof
Doubleclick on test.cmd and choose Run.

The first time the files in the current file panel are listed in the console (as expected), but thereafter when running test.cmd this way the files in the opposite file panel are listed in the console window. Really weird! :roll:

If you leave the current folder and go back into it, or if you press Ctrl+R you can reset the Run once, whereafter it continues to list the opposite panel - even if you change directory in the opposite panel.

It only happens if you Run test.cmd from the left panel, not from the right panel!

It also only happens when using cm_ContextMenuInternalCursor/cm_ContextMenuInternal (DoubleClick or Enter), but NOT with cm_ContextMenu (Right click or Shift+F10)
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
eugensyl
Power Member
Power Member
Posts: 564
Joined: 2004-06-03, 18:27 UTC
Location: România
Contact:

Post by *eugensyl »

Thank you Petermad!

My english is so bad? Of course...
In a color scale mine is black and white and yours is colorful.

Yes you have all right. Your explanations are much clear.
My Best Wishes,

Eugen
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48097
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

OK I could confirm it too now: TC doesn't explicitly set the current path when using a menu (_open=* option), otherwise it does set it. I will change that.
Author of Total Commander
https://www.ghisler.com
Post Reply