Search code examples
windowsshortcut

How to create a universal windows shortcut?


I have created a shortcut for my program (under Windows 7), whose target is in a sub-directory. But when I zip everything and send it to my colleague, the shortcut wont work because it the target directory cannot be found, it is like:

Target: C:\Users\my_user_name\Desktop\my_program\sub_directory\my_program.exe

and the shortcut is in C:\Users\my_user_name\Desktop\my_program\

When I send it to another PC, my_user_name directory cannot be found and shortcut doesnt work. How to solve this?


Solution

  • Create a batch file that launches the program. You can then use a relative path.

    e.g.

    C:\Users\my_user_name\Desktop\my_program\launch.cmd

    cd sub_directory
    start my_program.exe