public static void CreateShortcut(ShortcutInfo info) { var sanitizedLinkFile = info.DestinationPath.GetChildFileWithName(MakeValidShortcutFileName(info.Name)); var shortcut = new ShellLink { Target = info.Target.ToString(), Arguments = info.Arguments, WorkingDirectory = info.WorkingDirectory?.ToString(), Description = info.Description, IconPath = info.Icon?.ToString() }; shortcut.Save(sanitizedLinkFile.ToString()); }
public static Task CreateShortcutAsync(ShortcutInfo info) => Task.Run(() => CreateShortcut(info));