Solved

Need script that WORKS to pin apps to the start menu and task bar for Windows 7

Posted on 2011-09-22
11
1,139 Views
Last Modified: 2012-05-12
I've been looking over code, scripts, and web pages that claim to pin things to the start menu and taskbar.  I need something that will work.  I'm not a coder.  I keep getting error messages and I don't have the luxury of figuring out why one part of a script fails while another doesn't.

I have Windows 7 Profesional 32 bit.  I'm trying to pin Outlook 2007, Excel 2007, Word 2007, and and a program called Zscope. (the shortcut for Zscope is listed in C:\ProgramData\Microsoft\Windows\Start Menu\Programs\zScope\Express 3270 v6.2\zScope Express 3270 v6.2.lnk)

Can someone PLEASE help me with this?

0
Comment
Question by:cknoderer
11 Comments
 
LVL 66

Expert Comment

by:johnb6767
ID: 36581352
Coming from MS, I would think this one WOULD work....

Pin Items to the Start Menu or Windows 7 Taskbar via Script
http://blogs.technet.com/b/deploymentguys/archive/2009/04/08/pin-items-to-the-start-menu-or-windows-7-taskbar-via-script.aspx

Haven't tested personally.....

FYI, nice write up on the details on the Taskbar pinning here.... (for a mandatory profile, but the basics in the FileSystem/Registry are the same....) Could help you maybe configure them via GPP?

http://www.bdts.com.au/tips/50-windows-7/143-pinned-taskbar-icons-for-network-users.html
0
 
LVL 1

Author Comment

by:cknoderer
ID: 36581948
As I had written, I am not a coder. I really am not in a position to sit down and figure this out due to the busy work schedule I have. I was hoping someone could help explain this better or be able to provide a template code that I could EASILY modify to pin the specific programs I have listed.  
0
 
LVL 66

Expert Comment

by:johnb6767
ID: 36582076
I should have clarified... In the .zip file there are sample scripts already there. Inside PinItem.VBS, at the top, there is usage instructions.....

'* Usage:  cscript PinItem.vbs /item:<path to exe>
'*                 [/taskbar] [/?]
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 65

Expert Comment

by:RobSampson
ID: 36584015
Hi, see if this works for you.

Regards,

Rob.
arrFileNames = Array( _
	"C:\Program Files\Microsoft Office\Office14\winword.exe", _
	"C:\Program Files\Microsoft Office\Office14\winword.exe", _	
	"C:\Program Files\Microsoft Office\Office14\winword.exe", _
	"C:\Program Files\Microsoft Office\Office14\winword.exe" _
	"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\zScope\Express 3270 v6.2\zScope Express 3270 v6.2.lnk" _
	)
	
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShellApp = CreateObject("Shell.Application")
Set objShell = CreateObject("WScript.Shell")
For Each strFilePath In arrFileNames
	Set objFile = objFSO.GetFile(strFilePath)
	Set objFolder = objShellApp.Namespace(objFile.Parent)
	Set objFolderItem = objFolder.ParseName(objFile.Name)
	Set colVerbs = objFolderItem.Verbs
	For Each objVerb In colVerbs
		If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt
	Next
Next

Open in new window

0
 
LVL 2

Expert Comment

by:techdunes
ID: 36591179
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 36989384
The code I provided has worked in another EE question, so it should work fine here.  Comment ID 36584015

Rob.
0
 
LVL 66

Expert Comment

by:johnb6767
ID: 36989751
Works for me....
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 37022851
Here's a slight modification, allowing for Start Menu and Taskbar pinning.

Rob.
arrFileNames = Array( _
	"C:\Program Files\Microsoft Office\Office14\winword.exe", _
	"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\zScope\Express 3270 v6.2\zScope Express 3270 v6.2.lnk" _
	)
	
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShellApp = CreateObject("Shell.Application")
Set objShell = CreateObject("WScript.Shell")
For Each strFilePath In arrFileNames
	If objFSO.FileExists(strFilePath) = True Then
		Set objFile = objFSO.GetFile(strFilePath)
		Set objFolder = objShellApp.Namespace(objFile.ParentFolder & "\")
		Set objFolderItem = objFolder.ParseName(objFile.Name)
		Set colVerbs = objFolderItem.Verbs
		For Each objVerb In colVerbs
			If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt
			If Replace(objVerb.name, "&", "") = "Pin to Taskbar" Then objVerb.DoIt
		Next
		WScript.Echo strFilePath & " has been pinned."
	Else
		WScript.Echo "Could not find " & strFilePath
	End If
Next

Open in new window

0
 
LVL 59

Expert Comment

by:LeeTutor
ID: 37052281
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Utilizing an array to gracefully append to a list of EmailAddresses
When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
This Micro Tutorial will go in depth within Systems and Security in Windows 7 and will go into detail regarding Action Center, Windows Firewall, System, etc. This will be demonstrated using Windows 7 operating system.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question