none
How to unpin shortcut from start menu using "Remove from this list" option or "Unpin from Start Menu" option using VB script

    Question

  • Hi
       I have an issue with unpinning the shortcut from the Start Menu. When I right click on the shortcut and select the option "REmove from this list", the shortcut gets removed manually.

    But when i try to use the following script to remove the shortcut it does not work.
    Shortcut name in Start menu: Sap Logon Pad.lnk

    Script Used:
    ************************************************************
    dim objShell,filesystem,objFolder,objFolderItem, colVerbs
    dim objVerb
    Set objShell = CreateObject("Shell.Application")
    set filesystem = CreateObject("scripting.Filesystemobject")
    Set objFolder = objShell.Namespace(filesystem.GetParentFolderName("C:\Program Files\SAP\SapSetup\setup\SAL\saplgpad.s8l")) 
    Set objFolderItem = objFolder.ParseName(filesystem.GetFileName("C:\Program Files\SAP\SapSetup\setup\SAL\saplgpad.s8l")) 
    Set colVerbs = objFolderItem.Verbs 
    For Each objVerb in colVerbs 
    msgbox objVerb  
    If Replace(objVerb.name, "&", "") = "UnPin from Start Menu" Then objVerb.DoIt       
    Next 

    *****************************************************************


    The above script is used for the saplgpad.s8l file. When we right click on this file we do not get the Pin to Start Menu option.
    However we can drag and drop this file in Start Menu.
    But during removal of this file or shortcut poitning to thi file we get the "Remove From this list" option on right click.

    Please suggest how can we use the "Remove from this list" option to remove the shortcut from Start Menu using VB script or batch script.
    if there is any other option to resolve this issue using VB script or batch script or some commands please let me know.


    Wednesday, July 06, 2011 9:15 AM