Question : How to pin shortcut to Start menu using command line or script

I am trying to pin or add a shortcut to the Start menu but haven't found a way yet.  The reason I want to script it is because I plan to use SMS/SCCM to push this out to multiple machines.  I know the manual process for doing this is to right click on a short and choose "pin to start menu" or simply drag the shortcut to the Start menu.

Answer : How to pin shortcut to Start menu using command line or script

Hi darklord12,

If I create the shortcut like this it works (Win XP):

1. Right-click in a folder and select New -> Shortcut

2. In Type the location of the item, copy and paste the following line completely and click Next:
"%ProgramFiles%\Internet Explorer\iexplore.exe" https://vmc.designclinicals.com/medstracker/live/login.php

3. In Type a name for this shortcut, enter the friendly name for the link, anything at all, for example: Intranet Login Page

4. Click Finish.

This creates a shortcut called 'Intranet Login Page' which when double-clicked opens IE with the page 'https://vmc.designclinicals.com/medstracker/live/login.php' loaded.

In this exact example, if you then copy the shortcut to, say, C:\Shortcuts, you can then run the short script below to add it to the start menu.

Hope this helps,
Daz.
1:
2:
3:
4:
5:
6:
7:
8:
strShortcutFile = "Intranet Login Page.lnk"
strShortcutFolder = "C:\Shortcuts"
 
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(strShortcutFolder)
Set objFolderItem = objFolder.ParseName(strShortcutFile)
 
objFolderItem.InvokeVerb("P&in to Start Menu")
Random Solutions  
 
programming4us programming4us