问题
I have many shortcuts on the desktop and some work on the newer windows store apps that reside in the windowsapps folder, that cannot be run by clicking the exe file. so I want to use a button in my c#.net winforms app so when I click on it, it is the same as if I double clicked the icon on the desktop. I do not know enough about shell execute to know if that can do it. Any help would be greatly appreciated
回答1:
Have you tried System.Diagnostics.Process.Start(fullPath) in your button click handler? (Where fullpath is the full file path to your desktop shortcut i.e C:/Users/Me/Desktop/shortcut.lnk)
来源:https://stackoverflow.com/questions/38938775/how-to-use-a-button-click-event-in-c-sharp-to-activate-run-a-desktop-shortcut-to