2

Possible Duplicate:
How do you create an application shortcut (.lnk file) in C# or .Net

I guys I needed a help on how to create a application shortcut programmaticaly in c#

Community
  • 1
  • 1
Krish
  • 137
  • 1
  • 3
  • 12

1 Answers1

5

Try this.

http://vbaccelerator.com/article.asp?id=4301

  private static void configStep_addShortcutToStartupGroup()
    {
            using (ShellLink shortcut = new ShellLink())
            {
                    shortcut.Target = Application.ExecutablePath;
                    shortcut.WorkingDirectory = Path.GetDirectoryName(Application.ExecutablePath);
                    shortcut.Description = "My Shorcut Name Here";
                    shortcut.DisplayMode = ShellLink.LinkDisplayMode.edmNormal;
                    shortcut.Save(
                            STARTUP_SHORTCUT_FILEPATH);
            }
    }

Here is a CodeProject example on the same topic.

Jimmie Clark
  • 1,878
  • 13
  • 25