Desktop Shortcut

This is a discussion on Desktop Shortcut within the C# Programming forums, part of the General Programming Boards category; I'm creating an installer and I can't find a good location on how to create an desktop shortcut. Any ideas ...

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    6

    Desktop Shortcut

    I'm creating an installer and I can't find a good location on how to create an desktop shortcut. Any ideas or suggestions are appreciated.

    Thanks,
    Josh

  2. #2
    Registered User
    Join Date
    Nov 2006
    Posts
    6
    Figured it out. By using the WIndows scripting object host as a reference and putting "using IWshRuntimeLibrary;", this function creates the desktop shortcut.

    Code:
    private void appShortcutToDesktop()
            {
                string shortcutFullName = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + "\\Name.lnk";
                WshShell shell = new WshShellClass();
                IWshShortcut link = (IWshShortcut)shell.CreateShortcut(shortcutFullName);
                link.TargetPath = "C:\\FOLDER\\EXECUTEME.exe";
                link.Description = "DESC OF WHOAH";
                link.Save();
            }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Extended Desktop Dimensions
    By Jaken Veina in forum Windows Programming
    Replies: 2
    Last Post: 01-16-2009, 08:15 AM
  2. Getting Icons from the Desktop
    By Mastadex in forum Windows Programming
    Replies: 6
    Last Post: 08-29-2007, 04:33 PM
  3. "Organizing" Your Desktop for Coding
    By skim in forum Windows Programming
    Replies: 2
    Last Post: 03-13-2006, 05:52 PM
  4. Showing Desktop SW_DEFAULT
    By Yuri in forum Windows Programming
    Replies: 6
    Last Post: 11-20-2005, 12:28 PM
  5. shortcut problem
    By Micko in forum Tech Board
    Replies: 3
    Last Post: 09-17-2004, 03:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21