I am trying to create a link to a folder such as

C:\Program Files (x86)\7-Zip

I have tried to use href, but as I understand that automatically appends a .pdf to the end.

I tried the solution in hyperref: How to open a directory view with href{...}?

but no success there either. The documentation http://www.tug.org/applications/hyperref/manual.html seems to imply that \url{} can be used for paths. But this just generated a text version of the url.

What is the correct method for linking to a folder? Am I misusing a method or am I not using the correct approach?

Thanks in advance

  • 2
    Welcome to TeX - LaTeX! Please post the code you have tried. Loading hyperref and using \url should work, but will display the path name in the file too. What end result do you want? Jun 6, 2018 at 8:59
  • If you give a pathname to MS internet explorer, it will display the directory, but this is not standard behavior. The first thing it should do is look for home.html or index.html. Firefox defaults to using the search engine. Jun 7, 2018 at 15:08

4 Answers 4


For local paths:


The trailing period looks like a file extension so hyperref doesn't try to be smart and append ".pdf".

For UNC paths you need to double the leading forward-slashes for some reason:


There's no need to slash-escape embedded space characters in the path.

I haven't been able to get the usually-recommended \href{run:.......} syntax working for directories.

Tested on MikTeX (via Sweave) in Windows 10.


On MacOS, the MWE below produces:

enter image description here

and upon clicking on the link it invokes Finder and opens to the ../images directory.


  • Only relative links work. Absolute directory paths do not seem to work.



    \href{run:../images}{My Images Folder}

If it's a network folder, you can give the absolute path with




For example

\href{run:///}{Network Folder}

If it's a local folder, you can give the absolute path with


For example

\href{run://Users/Name/Downloads}{My Downloads Folder}

Tested with Adobe Acrobat Pro DC Version 2020.009.20065.


This is not a solution, but it does show some of my experiments.


\url{C:/Program Files (x86)/7-Zip}% replace \ with /

\href{../slides/demo}{pdf}% relative pathname

\href{../slides}{directory}% does nothing

\href{../slides/}{directory}% does nothing

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .