why internal association can't use user defined command?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
cheming
Member
Member
Posts: 154
Joined: 2004-05-07, 14:38 UTC
Location: China

why internal association can't use user defined command?

Post by *cheming »

what a handy function!

think about XMind(http://www.xmind.net/download/portable/). If I use xmind.exe directly, it will refused to run because the main program use a portable .ini to find some directories it used. In that .ini, something just like this :
-startup
../Commons/plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library

when the TC open the main program, it find direct based on the CURRENT dir, so it can't find the correct ones.

If internal association can let me use the command I defined in usercmd.ini, so I can specify the STARTUP dir for it.
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1052
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

You could put a Start_Exe.cmd next to the Exe:

Code: Select all

cd /d %~dp0
start "" xmind.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
This will change the working dir to the .cmd file.

Then use it with your Open command.
In wincmd.ini:

Filter1_open=C:\Programs\Xmind\Start_Exe.cmd "%1"
User avatar
white
Power Member
Power Member
Posts: 6014
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: why internal association can't use user defined command?

Post by *white »

cheming wrote:when the TC open the main program, it find direct based on the CURRENT dir, so it can't find the correct ones.

If internal association can let me use the command I defined in usercmd.ini, so I can specify the STARTUP dir for it.
Create a shortcut for your program (with start folder) and use the shortcut instead of the .exe file in the internal association.

Note: if you use the browse button to select your shortcut file then the shortcut file may be resolved to the .exe file. To prevent this, don't use the browse button but enter the path to the shortcut manually, or open the browse dialog and enter "*.lnk" in the file name field (not file type field!) and hit enter and then select your shortcut file (works on my computer running Windows XP).
cheming
Member
Member
Posts: 154
Joined: 2004-05-07, 14:38 UTC
Location: China

Post by *cheming »

Both solutions are too inconvenient. :-(
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

You can execute cm- or em-commands using tools like TCFS2 or TCMC. E.g. using TCFS2:

Code: Select all

TCFS2.exe /ef "tem(em_CdDocuments)"
Don't forget that your em-command should pass focused file (or selection) to program to be launched.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 7025
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

cheming wrote:Both solutions are too inconvenient. :-(
Sorry, but what is so inconvenient in creating a shortcut ?
Post Reply