Run application via shortcut using Process.Start C#

后端 未结 4 773
南笙
南笙 2020-11-29 11:31

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

4条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-29 11:48

    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.

提交回复
热议问题