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,163 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

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
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.

739 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