When it comes to deployment, many OS designers / Systems Architects etc. may want to have a static set of shortcuts pinned to the default Users Start Menu in Windows 7.
Sounds simple, but the mechanism has changed with the new Vista based Start Menu and has become a little more tricky.
Unfortunately there no longer is a way in Windows 7 to pin items / shortcuts to the start menu for all users.
Instead of a simple copy job to the All Users Start Menu Folder, we’ll have to use Verbs to get this done. Thus, we’ll have to actually create a RunOnce Task for every new user using the Public Users NTUSER.dat
Here’s a small script that does the trick.
Simply copy the content of the zip file on all target systems first (permanently), then load the Public Users NTUSER.dat file and add a RunOnce key to execute the batch file.
This is the actual VBS Code:
1 2 3 4 5 6 7 8
set objFileSystem = CreateObject("Scripting.FileSystemObject") Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace(objFileSystem.GetFile(Wscript.ScriptFullName).ParentFolder & "\Shortcuts\") Set objFolderItem = objFolder.ParseName(WScript.Arguments(0)) Set colVerbs = objFolderItem.Verbs For Each objVerb in colVerbs If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt Next
Here’s the Package:
PinItems.zip (3.1 KiB, 888 hits)
The Batch file parses the folder containing the shortcuts and executes the VB Script along with the Shortcut’s Filename as an Argument.