mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-09-28 15:21:37 +12:00
[BUG] Fix FileNotFoundException - Option GenerateDriveShortcuts - in case Windows Defender triggered (#272), version 1.2.0.3
This commit is contained in:
parent
6d3832521f
commit
401e1329f1
1 changed files with 10 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue