Solved

Script to Pin Folder to Classic Shell Start Menu

Posted on 2016-07-23
3
51 Views
Last Modified: 2016-09-21
Hi All,

We are using Classic Shell.
Desired result: A Folder on Classic Shell Start Menu that will  display it like a "Menu"
It should be done via script.

When I right click the folder and select "Pin to Start menu (Classic Shell)"  It creates the desired result.

When I create Shortcut and paste it in %appdata%\ClassicShell\Pinned\  It does not produce the desired result. No Menu of folder content.
Same result when I drag/drop>"Created shortcut Here"


Source Folder is %appdata%\Microsoft\Windows\Start Menu\Programs\GGHC
Destination folder for Pin to Start menu (Classic Shell) is %appdata%\Classic Shell\Pinned

OS:
Windows 10
Windows 2012R2

I have tried a 'Pin To Start Menu' that I used on Windows 7 but that appears to only work for files, not Pinning Folders.
7-23-2016-1-36-37-PM.jpg
0
Comment
Question by:GGHC
3 Comments
 
LVL 28

Expert Comment

by:serialband
ID: 41726077
Maybe these might work...

https://blogs.technet.microsoft.com/heyscriptingguy/2004/11/11/can-i-pin-a-file-to-the-start-menu-by-using-a-script/
Set objShell = CreateObject(“Shell.Application”)

Set objFolder = objShell.Namespace(“C:\Windows\System32”)

Set objFolderItem = objFolder.ParseName(“calc.exe”)


objFolderItem.InvokeVerb(“P&in to Start Menu”)

Open in new window


http://ss64.com/vb/syntax-pin.html

PIN.vbs
Dim strFolder, strExecutable
Set objShell = CreateObject("Shell.Application")

strFolder = "C:\Windows\System32\"
strExecutable = "notepad.exe"

Set objFolder = objShell.Namespace(strFolder)
Set objFolderItem = objFolder.ParseName(strExecutable)

Set colVerbs = objFolderItem.Verbs

'uncomment this section to display the available verbs
' For Each objVerb In colVerbs
' 	If objVerb <> "" Then
' 		WScript.Echo objVerb
' 	End If
' Next

'Loop through the verbs and if PIN is found then 'DoIt' (execute)
blnOptionFound = False
For Each objVerb In colVerbs
	If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then
		objVerb.DoIt
		blnOptionFound = True
		WScript.Echo "The application '" & strExecutable & "' was just Pinned to the Start Menu."
	End If
Next

if blnOptionFound = false then
	WScript.Echo "The application '" & strExecutable & "' was already pinned to the Start Menu."
end if

Open in new window

0
 

Accepted Solution

by:
GGHC earned 0 total points
ID: 41737244
I ended up doing a work around. I precreated the Shortcuts and did a Run Once copy since ClassicShell is Shortcut friendly
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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
#Citrix #XenApp #Citrix Scout #Citrix Insight Services #Microsoft VMMAP #Microsoft ADEXPLORE #Microsoft RAMMAP #Microsoft TCPVIEW #Microsoft AUTORUNS #Microsoft PROCESS EXPLORER #Microsoft PROCESS MONITOR
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

910 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

21 Experts available now in Live!

Get 1:1 Help Now