Open SonnyX opened 3 years ago
IShellLink link = (IShellLink)new ShellLink(); // setup shortcut information link.SetDescription("My Description"); link.SetPath(@"c:\MyPath\MyProgram.exe"); // save it IPersistFile file = (IPersistFile)link; string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory); file.Save(Path.Combine(desktopPath, "MyLink.lnk"), false);
https://docs.microsoft.com/en-us/windows/win32/shell/links#creating-a-shortcut-and-a-folder-shortcut-to-a-file
https://docs.microsoft.com/en-us/windows/win32/shell/links#creating-a-shortcut-and-a-folder-shortcut-to-a-file