Is there a way to run an application via shortcut from a C# application?
I am attempting to run a .lnk from my C# application. The shortcut contains a significant n
Setting UseShellExecute = false
was the problem. Once I removed that, it stopped crashing.
If you're using UseShellExecute = false and trying to launch a batch file make sure to add .bat to the end of the filename. You don't need .bat if UseShellExecute = true though. This made me just waste an hour of work... hoping to save someone else.
Could you post some code. Something like this should work:
Process proc = new Process();
proc.StartInfo.FileName = @"c:\myShortcut.lnk";
proc.Start();
if your file is EXE or another file type like ".exe" or ".mkv" or ".pdf" and you want run that with shortcut link your code must like this.
i want run "Translator.exe" program.
Process.Start(@"C:\Users\alireza\Desktop\Translator.exe.lnk");