0

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();
        }
    }
}
  • Are you writing some sort of Installer yourself? – Ralf Jul 25 '23 at 12:57
  • @Ralf Not an installler.Actually this is a task i got from my team lead.When we are searching for an application in search bar it should shown option1 and option2 instead of showing start ,run as administrator,open file location. – Divya Sri Thokala Jul 26 '23 at 01:32

0 Answers0