VBScript – Pin to Start Menu

Hello everyone!

Today I would like to share with you a nice script a colleague of mine sent me, that do the  “Pin to Start Menu” trick.

This works for Windows Vista and also Windows 7.

Set objShell = CreateObject("Shell.Application")

Set objFolder = objShell.Namespace("C:\Users\victorma\Desktop")

Set objFolderItem = objFolder.ParseName
("Nero StartSmart.lnk")

For each verb in objFolderItem.Verbs()
  ‘WScript.Echo verb
  if verb.Name = "P&in to Start Menu" then verb.DoIt()
Next

Just a brief explanation:

objFolder – This is where the file you want to pin is.

objFolderItem – This is the actual file.

‘WScript.Echo verb – You can uncomment to see the script in action.

"P&in to Start Menu" then verb.DoIt() – This is the action you want to use.

 

You should uncomment the line ‘WScript.Echo verb because de verb could change from one Windows version to another.

This script can be used to perform other actions like, “Add to Quick Launch”, etc.

One Response to “VBScript – Pin to Start Menu”

  1. Alistair Says:

    G’day

    I am looking for a script which i can send out to someone overseas, which when opened will set up and send a remote assistance invitation to my email address?

    Cheers
    AC

Leave a Reply