locked
how to unpin a shortcut from start menu RRS feed

  • 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 

    *****************************************************************
    Please suggest if there is any other option to resolve this issue using VB script or batch script or some commands. As this shortcut does not point to a EXE file and points to a "saplgpad.s8l" file which is a launcher file, please suggest any solutions.

    Wednesday, July 6, 2011 5:10 AM