/// <summary>
/// 创建桌面快捷方式
/// </summary>
/// <param name="targetPath">可执行文件路径</param>
/// <param name="description">快捷方式名称</param>
/// <param name="iconLocation">快捷方式图标路径</param>
/// <param name="workingDirectory">工作路径</param>
/// <returns></returns>
public static bool CreateDesktopShortcut(string targetPath, string description, string iconLocation = null, string workingDirectory = null)
{
if (string.IsNullOrEmpty(workingDirectory))
{
workingDirectory = Shortcut.GetDeskDir();
}
return Shortcut.CreateShortcut(Shortcut.GetDeskDir() + "\\" + description + ".lnk", targetPath, workingDirectory, description,
iconLocation);
}
/// 创建桌面快捷方式
/// </summary>
/// <param name="targetPath">可执行文件路径</param>
/// <param name="description">快捷方式名称</param>
/// <param name="iconLocation">快捷方式图标路径</param>
/// <param name="workingDirectory">工作路径</param>
/// <returns></returns>
public static bool CreateDesktopShortcut(string targetPath, string description, string iconLocation = null, string workingDirectory = null)
{
if (string.IsNullOrEmpty(workingDirectory))
{
workingDirectory = Shortcut.GetDeskDir();
}
return Shortcut.CreateShortcut(Shortcut.GetDeskDir() + "\\" + description + ".lnk", targetPath, workingDirectory, description,
iconLocation);
}