Solved

Script to Pin Folder to Classic Shell Start Menu

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

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
address book on outlook 2016 mac 7 47
Folder size tool 6 61
Printer Settings 3 64
server plus 2 46
Utilizing an array to gracefully append to a list of EmailAddresses
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

706 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

15 Experts available now in Live!

Get 1:1 Help Now