public 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 == null ? null : info.WorkingDirectory.ToString(), Description = info.Description, IconPath = info.Icon == null ? null : info.Icon.ToString() }; shortcut.Save(sanitizedLinkFile.ToString()); }
public Task CreateShortcutAsync(ShortcutInfo info) { return Task.Run(() => CreateShortcut(info)); }