none
add shortcut to recent start menu RRS feed

  • Question

  • I am using the following code to try to add shortcut to the recent part of start menu (not to the start menu programs) but nothing is happening.

    where is the problem?

    WshShell shell = new WshShell();
    IWshShortcut MyShortcut;
    // Replace [UserName] with the name of the User
    MyShortcut = (IWshShortcut)shell.CreateShortcut(Environment.GetFolderPath(Environment.SpecialFolder.Recent) + "\\" + Application.ProductName + ".lnk");
    MyShortcut.TargetPath = Application.ExecutablePath;
    MyShortcut.Description = "Launch the App!";
    // MyShortcut.IconLocation = [IconPath]; // [IconPath] - the path of the icon for the shortcut, if you have one 
    MyShortcut.Save();
    



    Jassim Rahma

    Monday, July 23, 2012 8:42 PM

Answers

  • Hi Jassim,

    Welcome to the MSDN Forum.

    This is added by OS, a programmer or user cannot control it.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, July 24, 2012 10:46 AM
    Moderator

All replies

  • Your code produced a shortcut called Consoleapplication1 (the visual studio project name) in the folder "My recent Documents" (from : Environment.SpecialFolder.Recent).


    jdweng

    Monday, July 23, 2012 9:29 PM
  • Hi Jassim,

    Welcome to the MSDN Forum.

    This is added by OS, a programmer or user cannot control it.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, July 24, 2012 10:46 AM
    Moderator