/build/static/layout/Breadcrumb_cap_w.png

How to pin a website shortcut to the Startmenu in Windows7

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
Next


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

Answers (4)

Posted by: mahendraKumar 12 years ago
Senior Yellow Belt
0
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.
Posted by: anphi 12 years ago
Orange Belt
0
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..:)
[:D]

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
Posted by: mahendraKumar 12 years ago
Senior Yellow Belt
0
I guess your client might use IE 9 or above...
Posted by: pjgeutjens 12 years ago
Red Belt
0
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.

PJ
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ