Solved

Script to Pin Folder to Classic Shell Start Menu

Posted on 2016-07-23
3
54 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

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

#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

777 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