I have an application Test.exe in C:/Program Files/Test folder. I need to place a shortcut of Test.exe in a folder on desktop with name TestShortcut.lnk. If a user run the application via shortcut, how would I programmatically get the the path and filename of the TestShortcut.lnk instead of the actual Test.exe in C#.
Asked
Active
Viewed 346 times
0
-
2Would [this](https://stackoverflow.com/questions/9414152/get-target-of-shortcut-folder) SO post be of any use to you? – Simon Wilson Feb 04 '20 at 21:36
-
I tried the everything that's in the link, could get that to work. All i'm getting is path to original executable. – Feb 04 '20 at 21:49
-
4You can't know if an process got started from a short cut or anywhere else for that matter, unless you use some convention, for example, have the shortcut add an argument to the program. – rene Feb 04 '20 at 22:06
-
1Does this answer your question? [Get target of shortcut folder](https://stackoverflow.com/questions/9414152/get-target-of-shortcut-folder) – Julian Feb 06 '20 at 22:38
-
yes, i was able to get the file path of executable with rene's comment – Feb 07 '20 at 21:15