Reputation: 1
How to customize the properties of the startmenu shortcut desktop application implemented in C# and .NET 4.7?
I had created desktop application shortcut using IWshRuntimeLibrary,WshShell,IWshShortcut and the application name as exe1.I was stuck on customizing the properties such as start,run as administrator,open file location to option1 and option2. How may the application be customized?
Here is the C# code for shortcut desktop application:
using System;
using System.Windows.Forms;
using IWshRuntimeLibrary;
namespace Shortcut2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
WshShell shell = new WshShell();
IWshShortcut exe1 = (IWshShortcut)shell.CreateShortcut(@"C:\Users\DIVYASRI\Start\exe1.lnk");
exe1.TargetPath = Application.ExecutablePath;
exe1.Description = "Launch the App";
exe1.Save();
}
}
}
Upvotes: 0
Views: 71