Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pin short to Start Menu on Winows XP and Windows 7

Status
Not open for further replies.

MarBra

IS-IT--Management
Aug 21, 2013
7
0
0
US
I'm working at a school and need to pin certain icons and shortcuts to the start menu. I have the icons figured out but I'm having some trouble pinning a short cut.
 
Explain what you mean by an 'icon' and a 'shortcut', normally if a shortcut not having an icon associated with it, would indicate that the target file or application is missing.

Also is start menu dragging and dropping enabled?

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Sorry for being vague...Below is what I'm using to pin an application icon to the start menu of an xp machine. I need to also pin a shortcut to and application that is on an network share.

What needs to run on windows xp
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\Windows\System32")
Set objFolderItem = objFolder.ParseName("Notepad.exe")
objFolderItem.InvokeVerb("P&in to Start Menu")
 
If I put something like what I have below to pin a shortcut doesn't put the icon on the start menu. I would like to know if my script is wrong or is there a different script I should be using?

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\Temp")
Set objFolderItem = objFolder.ParseName("Athena.lnk")
objFolderItem.InvokeVerb("P&in to Start Menu")
 
I think your verb is wrong. Should be ""Pin to Start Men&u". Instead of invoking the verb explicitly with .InvokeVerb(), gather the item's verbs an iterate through. Removing the ampersand from the verb name. Once you find the right verb ... [bigglasses] .doIt()

Code:
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\Temp")
Set objFolderItem = objFolder.ParseName("Athena.lnk")
[COLOR=#CC0000]set colVerbs = objFolderItem.verbs
for each objVerb in colVerbs
   if (replace(objVerb.Name, "&", "") = "Pin to Start Menu") then objVerb.doIt
next[/color]

The link I previously posted contains a link to a complete "pinning" script

-Geates

 
If the ampersand worked for pinning an exe on the same windows xp machine shouldn't it be the same for a .lnk? I'm using this exact code below on the same windows xp machine and I'm able to pin word, powerpoint, excel....but with their exe not .lnk.


Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\Temp")
Set objFolderItem = objFolder.ParseName("Athena.lnk")
objFolderItem.InvokeVerb("P&in to Start Menu")
 
So should your code work as is or do I need to find what should be in place of the ampersand?

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\Temp")
Set objFolderItem = objFolder.ParseName("Athena.lnk")
set colVerbs = objFolderItem.verbs
for each objVerb in colVerbs
if (replace(objVerb.Name, "&", "") = "Pin to Start Menu") then objVerb.doIt
next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top