Creating shortcut to an exe file in C#

I have a program that when I build on release mode in visual studio it will copy the .exe file and all required file to a shared location for multiple users to access. Inside the folder that was copied i created automatically created a shortcut to the .exe file using C# when the project builds.

Problem

I want to be able to copy that folder off the shared location and put it on any desktop and run that shortcut file. The problem is that the shortcut is still pointing to the .exe file on the shared location and not the local one. How can I set the target location for the shorcut to be relative to where ever i place that local folder?

Answers


From what I know, you can't actually have relative shortcuts in Windows. May one ask why you need a shortcut? Why not just use the executable I mean? :)

You could always create a .bat-script to launch your app. Still, I don't know what you want to do so I'm just throwing ideas out there.

Edit: If a .bat won't do, you could always create a new app in the project which itself acts as a shortcut.


Need Your Help

How to add zoom-in and zoom-out buttons in dc.geoChoroplethChart

javascript d3.js zoom geojson dc.js

I wanted to add zooming effect to dc.geoChoroplethChart(). I am able to get Zoom-in and Zoom-out behavior with wheelmouse. I achieved with the help of this example. But, how to achieve this using Z...

What is the preferred way to enqueue just a function in scriptaculous?

javascript scriptaculous effects

I have an application, that uses scriptaculous' effects queue to render the view of a game.