Generalhyperref | Start Windows Application

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
psionman
Posts: 30
Joined: Thu Nov 10, 2011 3:33 pm

hyperref | Start Windows Application

Post by psionman »

I'm want to allow my users to click on a link and run a windows (7) application. My code is:

Code: Select all

\documentclass[a4paper,11pt]{article}
\usepackage{hyperref}

\begin{document}
\href{run:C:/Program Files/AMPS Batch Allocation/AmpsBatchAllocation.exe}{Run}
\end{document}
The cursor recognises the hyperlink but clicking does nothing.

Is it possible to do this in LaTeX?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

hyperref | Start Windows Application

Post by kaiserkarl13 »

The following will try to open the actual file:

Code: Select all

\href{file:///C:/Program Files/AMPS Batch Allocation/AmpsBatchAllocation.exe}{Run}
That fails on my system (UNIX-based), since no application is registered to handle executables. It may work on Windows, though; I just have no way of checking. If not, it may be disabled for security reasons---I can easily see that technique as a way of spreading malicious software, for example.
psionman
Posts: 30
Joined: Thu Nov 10, 2011 3:33 pm

Re: hyperref | Start Windows Application

Post by psionman »

Thanks Kaiserkarl. I understand the security concern, but that is for the system administrator to sort out. It would seem strange if the writers of the hyperref package have taken on the role of deciding who can do what.

I can do this in M$ word, and much as I hate to, I think the document will need to be re-written in that package. :cry:
kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Re: hyperref | Start Windows Application

Post by kaiserkarl13 »

The writers of hyperref most likely didn't do anything; I was thinking the PDF format itself might have disabled that sort of link for security reasons.

If it doesn't work, perhaps it's because hyperref itself doesn't know about the "run:" protocol (which may be MS-Word specific). To test that, you could try putting the same link in an HTML document. I suspect that won't work either.
Post Reply