Hi team,

I am tryinig to put a website shortcut to the pinned Startmenu.
I have written a script for the same.but it is not working..

Set oShell = CreateObject("WScript.shell")
Set sh = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")

sFullPath = fso.GetParentFolderName(WScript.ScriptFullName) & "\NL-Banking Universe.url"
target = "C:\ProgramData\Microsoft\Windows\Caches\"

fso.CopyFile sFullPath, target

Set objShell = CreateObject("Shell.Application")

Set objFolder = objShell.Namespace("C:\ProgramData\Microsoft\Windows\Caches")
Set objFolderItem = objFolder.ParseName("NL-Banking Universe.url")
Set colVerbs = objFolderItem.Verbs
'objFolderItem.InvokeVerb("P&in to Start Menu") 'Tried this command, but not working"
For Each objVerb In colVerbs
If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt

I tried changing the extension from .url to .lnk..but I am getting the error " objFolderItem couldnot be found"

Windows7 will only take .exe shortcuts..?
0 Comments   [ + ] Show Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.


when you right click the file you will come to know whether we can Pin the file to taskbar or not.

URL shortcut does not supports it as far i checked ... sorry if am wrong...

I have tried your script for lnk shortcut.

the error in your script was

If Replace(objVerb.name, "&", "") = "Pin to Taskbar" Then objVerb.DoIt - "Pin to Taskbar" not "Pin to Start Menu" - Case Sensitive

this key word can vary depending on OS.
For WIn 7 - Pin to Taskbar
For Vista -Pin to Start Menu
so you can right click and check what is the option to pin to taskbar.
Answered 02/14/2012 by: mahendraKumar
Senior Yellow Belt

Please log in to comment
Hi Mahendra,

Even in the Windows7 that script worked earlier...but it was a shortcut for an exe file..

When I informed the client the same..he sent a screenshot back, in which the website shortcut was pinned to his start menu..:)

I tried with the Pin to Taskbar...but the same result....

shortcut does not supports it as far i checked ... sorry if am wrong...

I have
Answered 02/14/2012 by: anphi
Orange Belt

Please log in to comment
I guess your client might use IE 9 or above...
Answered 02/15/2012 by: mahendraKumar
Senior Yellow Belt

Please log in to comment
How about making a shortcut to iexplore.exe and adding the target website as a parameter, like

"C:\Program Files\Internet Explorer\iexplore.exe" www.appdeploy.com

not browser independent, but you can pin this to the taskbar. I suppose you could even look to see what the default browser is in
HKEY_LOCAL_MACHINE\Software\Clients\StartMenuInternet\ and set the shortcut accordingly.

Answered 02/15/2012 by: pjgeutjens
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity