Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

Is there a way to create a shortcut to an EXE on a USB thumb drive that will work no matter what drive letter is assigned to the thumb drive?

I have a program in a folder on a thumb drive. I want to create a shortcut in the root of the thumb drive that points to the program's EXE and will work no matter what drive letter is assigned to the thumb drive.

How can I do this?

share|improve this question

marked as duplicate by Karan, mdpc, Art Gertner, Kevin Panko, Ramhound May 17 '15 at 5:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 8 down vote accepted

You should be able to leave off the drive letter to create a relative pathname. For example, if your executable is at:

E:\folder\subfolder\program.exe

set the shortcut to be:

\folder\subfolder\program.exe

or perhaps:

folder\subfolder\program.exe

A bit of experimentation should reveal the correct format.

share|improve this answer
    
Relative is the way to go, +1. – John T Feb 24 '10 at 23:25
    
I just came across this. Windows has never supported creating shortcuts with relative paths AFAIK (if you leave out the drive letter it will still be added), so I don't know why this is the accepted answer. – Karan May 14 '15 at 20:03

We can also use batch files to achieve relative links.
Just put,

start path/to/program.exe

and put it in the root of the flash drive..
I am not sure if relative shortcuts(lnk files) can be used in windows...

share|improve this answer

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