Zim

Link to Program with Parameters (Win XP)

Asked by Florian Dee

Hello Jaap,

first of all thank you for this great tool.
My question: Is it possible to create a link to an external program if this link includes a slash character (/) followed by a parameter.
Example: c:\program files\totalcmd\totalcmd.exe /o /t /L=d:\

I tried using the link dialog as well as the urls.list.
The problem using urls.list seems to be that every slash is converted into a backslash.
I tried various combinations of escape and quoting characters without success.

Thanks in advance for your answer,
Florian

Question information

Language:
English Edit question
Status:
Solved
For:
Zim Edit question
Assignee:
No assignee Edit question
Solved by:
Jaap Karssenberg
Solved:
Last query:
Last reply:
Revision history for this message
Best Jaap Karssenberg (jaap.karssenberg) said :
#1

No, the links are file links, not commands. So it is not possible to link to
an excutable and then have it run when you click the link.

What you could do is set this command as the standard file browser command,
and then all file link swill open with this command.

-- Jaap

Revision history for this message
Florian Dee (efde) said :
#2

Thanks Jaap Karssenberg, that solved my question.

Revision history for this message
Florian Dee (efde) said :
#3

Hi Jaap,

just for your information: Just running the executable works fine. If I define in urls.list for example
prog file:///c:/programs/program.exe
I can call program.exe by using prog? in Zim.

The problem is if I define
prog file:///c:/programs/program.exe {NAME}
and try either prog?parameter or prog?/parameter Zim tells me "No such file or folder".
Maybe one day opening a program and passing parameters to it could be a nice feature of Zim?

As another side note: Adding totalcmd.exe as standard file browser is not that easy (in Win XP). Neither c:/program files/totalcmd/totalcmd.exe nor file:///c:/program files/totalcmd/totalcmd.exe nor totalcmd.exe work. After entering one of these and clicking on a file link nothing happens. I'll check my path variable but I'm confused because Zim does not give any feedback such as "command not found".

Cheers,
Florian

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) said :
#4

On Wed, Aug 17, 2011 at 12:11 PM, Florian Dee <
<email address hidden>> wrote:

> Question #168192 on Zim changed:
> https://answers.launchpad.net/zim/+question/168192
>
> Florian Dee posted a new comment:
> Hi Jaap,
>
> just for your information: Just running the executable works fine. If I
> define in urls.list for example
> prog file:///c:/programs/program.exe
> I can call program.exe by using prog? in Zim.
>

This is actually unintended behavior. We use the windows API to open a file
and let windows decide how to open it. Apparently that means it will run it
if the file is executable.

I don't think you can do it with the url list syntax because the whole URL
is considered one file, not a command plus arguments.

> The problem is if I define
> prog file:///c:/programs/program.exe {NAME}
> and try either prog?parameter or prog?/parameter Zim tells me "No such file
> or folder".
> Maybe one day opening a program and passing parameters to it could be a
> nice feature of Zim?
>

There is a proposal for plugins to be able to define new URL schemes. If we
have that you could make a small plugin to do it this way. I don't think I
will support it as a standard way because links are supposed to link files,
not command actions.

> As another side note: Adding totalcmd.exe as standard file browser is
> not that easy (in Win XP). Neither c:/program
> files/totalcmd/totalcmd.exe nor file:///c:/program
> files/totalcmd/totalcmd.exe nor totalcmd.exe work. After entering one of
> these and clicking on a file link nothing happens. I'll check my path
> variable but I'm confused because Zim does not give any feedback such as
> "command not found".
>

Did you check the log file ? It should be in the temporary folder. Any
errors from external commands that are not caught will end up there.

I think the same command as you run it in the terminal should also work as a
command in zim. If not please open a bug report for this.

-- Jaap