Link to home
Start Free TrialLog in
Avatar of GGHC
GGHC

asked on

Script to Pin Folder to Classic Shell Start Menu

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
Avatar of serialband
serialband
Flag of Ukraine image

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

ASKER CERTIFIED SOLUTION
Avatar of GGHC
GGHC

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial