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,129 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
 
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
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 give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

747 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now