Pin to Start Menu – Alternative Way

April 22, 2009

At the end of March, I’ve published a way to Pin to Start Menu the shortcuts you wanted.

Then after some testing and research I’ve found out the this could be a real pain to make this configuration to all users.

So…I’ve managed to find/get an alternative way to do this using the good old Default User + Registry.

To do this you’ll need to:

.: On a reference machine configure all your pinned shortcuts

.: Then go to registry:[HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\StartPage]

.: Export the reg key to a file and just the the keys:
  :: FavoritesResolve
  :: Favorites
  :: FavoritesChanges

.: Now using for example a vbscript you need to load the default user hive to “inject” your registry file.

Here’s an example on how to do this:

‘Pin Icons to Start Menu            
Wshshell.run "REG LOAD HKLM\TMP C:\Users\Default\ntuser.dat" 
WScript.Sleep 2000 
WshShell.run "REGEDIT /S C:\exportedregfile.reg" 
WScript.Sleep 2000   
Wshshell.run "REG UNLOAD HKLM\TMP"

And this will do the trick! :)


VBScript – Pin to Start Menu

March 30, 2009

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.