user commands rules

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

Post Reply
jcmn
Member
Member
Posts: 33
Joined: 2009 Nov 02, 11:00

user commands rules

Post by jcmn »

How can I build a user command to run an executable that uses data from a INI file that is located in the same folder of the executable?

If I execute it with the folder not loaded in the focused tab it doesn't work.
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

Did you include the full path to the executable, as in "C:\Program Files\..."?
jcmn
Member
Member
Posts: 33
Joined: 2009 Nov 02, 11:00

Post by jcmn »

Yes I did!
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1241
Joined: 2005 Oct 16, 19:09

Post by FrizzleFry »

If the program does not look in it's own folder for the ini then maybe you need to send the full path of the ini as a parameter... you would need to check if the program allows this.
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

or run it from a .bat or .cmd file where first line is to change the current (working) directory to the location of the executable:

Code: Select all

cd <fullpathtoexecutable>
<executable> [your usual parameters]
jcmn
Member
Member
Posts: 33
Joined: 2009 Nov 02, 11:00

Post by jcmn »

fgagnon wrote:or run it from a .bat or .cmd file where first line is to change the current (working) directory to the location of the executable:

Code: Select all

cd <fullpathtoexecutable>
<executable> [your usual parameters]
Can I use this code in the User command?
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

That's just a generic approach I used 'way back in DOS daze.

The .bat/cmd would be put on the command line, and parameters passed to it via %1, %2, etc.refs in the .bat/cmd file which would import the explicit params from the command line.

probably needs some syntax mod for use from x2 addressbar or user commands, depending on specific command(s) parameter(s) you are using.
Post Reply