开发者

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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜