In org-mode (note I am running Windows), when creating a link using C-c C-l, using the following path loads my email software when clicking on the resulting link:

file:c:/Program Files/The Bat!/thebat32.exe

So far, so good.

However, when adding an argument to the executable emacs complains the file does not exist, for example clicking on the resulting link for

file:c:/Program Files/The Bat!/thebat32.exe argument1

yields an error message "No such file". It appears emacs/orgmode is checking if the file exists using an absolute path including the argument, hence not finding it.

Is there any way to properly pass arguments to simple file calls? Or would one need to create a new hyperlink type as described in http://orgmode.org/manual/Adding-hyperlink-types.html?

1 Answer 1


I was able to solve this using an elisp: hyperlink rather than the file: hyperlink type. Specifically, my org-mode hyperlink code now reads:

elisp:(w32-shell-execute "open" "C:\\Program Files\\The Bat!\\thebat32.exe" "ARGUMENTS HERE")

Emacs by default brings up a security warning when evaluating elisp code when clicking a link. I don't mind the security hazards, so I turned off the warnings by setting "Org Confirm Elisp Link Function" to "no confirmation".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.