The subject title may not be entirely clear, so let me explain.
I have a ThinApp located on a file server. I have used ThinReg.exe to register the ThinApp on a Windows XP desktop and the shortcut appears in the Start Menu.
I would like to "Pin to Start Menu" this shortcut. However, I'm not getting this option when I right click the shortcut. Is this because the ThinApp is located on the file server? Is there any workaround because I use this method with my users' most frequently used applications and I don't want to have them navigate through the start menu to get to this app, i.e. Start Menu > All Program > .
Thanks
Hi,
I am not sure if the ThinApp tooling allows this. However, there are several other methods for doing so, see:
Best regards!
Thanks for the links TIJa! I looked at the first link as I'm not using Windows 7 and this part caught my attention:
After that we use the InvokeVerb method to pin the application to the Start Menu. Verbs are items that appear on the context menu when you right-click the application icon in Windows Explorer. And that’s not a misprint in P&in to Start Menu; the ampersand is part of the command name, and indicates the shortcut key for the item (in this case, the letter i). It looks weird, but it has to be there.
I'm not entirely sure, but even if I use a script if I don't have the "Pin to Start Menu" option when I right click the ThinApp shortcut in the start menu then I won't be able to call this function in a script. I haven't tested any script yet, so I may be wrong.
This appears to be a Windows limitation. I don't get the "Pin to Start Menu" context menu option for any shortcut that points to a file on a network drive, whether the target is a ThinApp executable or a "normal" executable. When I copy the same ThinApp package from the network drive to a local drive and run ThinReg on the local copy, shortcuts do have the "Pin to Start Menu" option.
I've tried to confirm this in official Microsoft documentation, but failed. However, searching for "Pin to Start Menu network" gave me plenty of results where people stated that it's not possible to pin shortcuts targetting network files to the Start Menu.
Yep, I've seen the same behaviour during my testing. After a couple of hours of googling and scripting I have come up with an automated solution.
Basically, there are two ways of "pinning" network shortcuts:
1) Create a new shortcut for a local application, i.e. notepad.exe. Pin it to the start menu and then change the target to point to your desired network ThinApp (or any other network file). Now delete the shortcut you made, i.e. the one you created on the desktop or elsewhere.
2) Modify the existing network shortcut target to point to a local application, i.e. notepad.exe. Pin it to the start menu and then change the target back.
I chose option (2) because I felt it was unnecessary to create and then delete a shortcut.
NOTE: This is my first VBS script and although I have worked on it for a few hours and tested it several times.
PLEASE TEST BEFORE USING IN A PRODUCTION ENVIRONMENT!
' Register ThinApp using THINREG
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.Exec("""\\Win2k3-srv\Apps\THINREG.EXE"" /Q ""\\Win2k3-srv\Apps\Firefox.exe""")
' Delay to ensure shortcut(s) created
Wscript.Sleep 1000
' Preserve shortcut target and then change to notepad.exe
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\Documents and Settings\<user name>\Start Menu\Programs\Mozilla Firefox")
Set objFolderItem = objFolder.ParseName("Firefox.lnk")
Set objShellLink = objFolderItem.GetLink
Set objShellLinkOriginal = objFolderItem.GetLink
Wscript.Echo objShellLink.Path
Wscript.Echo objShellLinkOriginal.Path
objShellLink.Path = "notepad.exe"
objShellLink.Save()
Wscript.Echo objShellLink.Path
Wscript.Echo objShellLinkOriginal.Path
' Pin to Start Menu
objFolderItem.InvokeVerb("P&in to Start Menu")
' Restore shortcut target
objShellLink.Path = objShellLinkOriginal.Path
objShellLink.Save()
Wscript.Echo objShellLink.Path
Wscript.Echo objShellLinkOriginal.Path
I would very much appreciate any improvements to the script. In particular it has two limitations that I would like to remove:
1) You have to specify the full path to the shortcut created by thinreg for each user, i.e.
Set objFolder = objShell.Namespace("C:\Documents and Settings\<user name>\Start Menu\Programs\Mozilla Firefox")
2) You have to specify the name of the shortcut in the location specified in (1) above, i.e.
Set objFolderItem = objFolder.ParseName("Firefox.lnk")
I'm still learning how to use ThinApp and eventually I'll want to use the script above to register multiple ThinApps in an AD environment, so the limitations above will be a problem.
Enjoy!
Hi,
The first problem should be solvable by using the %CSIDL_STARTMENU% variable, which resolves to a particular user's start menu location when ran from the user's context, see:
http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx
http://msdn.microsoft.com/en-us/library/bb762181(VS.85).aspx
I found an example in VBscript at this site: http://www.pcreview.co.uk/forums/thread-416978.php
Bye!
Tim
Hey TIJa! I had a look at your links and I tried that approach before I posted my script above. The problem is that it doesn't work by just specifying the user's start menu path, i.e.
CSIDL_STARTMENU (0x000b)
The file system directory containing Start menu items. A typical path is C:\Documents and Settings\username\Start Menu
If I don't specify the complete path to the shortcut then the script gives an error saying that it can't find Firefox.lnk.
Some things that we have done to help work around this that also provided a quicker benefit.
First right click on any application you want to have in this Apps listing, and then use the Send to->Desktop (Create Shortcut).
Then create a folder lets say Apps on your Network Drive. Once that is completed drag and drop shortcuts that you created on your desktop to your Z:\Apps folder (rename shortcuts if you wish).
Next right click on your start bar/taskbar and select Toolbars->New Toolbar...
Finally navigate to your Network Drive and highlight the Apps folder and then click the Select Folder button. You should see Apps on your taskbar, drag it all the way to the right. Then you should see >> when you click on them it should have a little pop-up mini menu of your apps.
