diff --git a/Utilities/GenerateDriveShortcuts.cs b/Utilities/GenerateDriveShortcuts.cs index 39c46b8..d18a1bc 100644 --- a/Utilities/GenerateDriveShortcuts.cs +++ b/Utilities/GenerateDriveShortcuts.cs @@ -4,6 +4,7 @@ namespace SystemTrayMenu.Utilities { + using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -39,7 +40,15 @@ namespace SystemTrayMenu.Utilities IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(linkPath); shortcut.Description = "Generated by SystemTrayMenu"; shortcut.TargetPath = targetPath; - shortcut.Save(); + + try + { + shortcut.Save(); + } + catch (Exception ex) + { + Log.Warn($"Could not create shortcut at path:'{linkPath}'", ex); + } } private static string GetLinkPathFromDriveName(string driveName)