Skip to main content
The 2024 Developer Survey results are live! See the results
added 121 characters in body
Source Link
Jimmie Clark
  • 1.9k
  • 13
  • 25

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.

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);
            }
    }

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.

Source Link
Jimmie Clark
  • 1.9k
  • 13
  • 25

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);
            }
    }