Sign in to follow this  
Followers 0

How do I pin a program to Start Menu

16 posts in this topic

#1 ·  Posted (edited)

I have written a script to install BitComet on a computer and add a CLSID for the My Computer and Control Panel to ease access to the folder containing the downloads. I want to pin the script to the Start Menu using AutoIt. The script's path is C:\WINDOWS\SCRIPT\BITCOMET.EXE (path in bold). Any ideas on how to do this? Any help would be appreciated! Thanks!

Edited by Dougiefresh

Share this post


Link to post
Share on other sites



#2 ·  Posted

I have a write up here. Granted, this is for a Windows XP unattended install though, the actual format is in binary, and I haven't really cracked the code yet. One other thing...Microsoft does NOT want software vendors to stuff pinned items onto the start menu. They want the user to do it themselves, which probably explains why they did it this way.

So for the moment, that's the best way of doing it.


The Maelstorm

Share this post


Link to post
Share on other sites

#3 ·  Posted

I have a write up here. Granted, this is for a Windows XP unattended install though, the actual format is in binary, and I haven't really cracked the code yet. One other thing...Microsoft does NOT want software vendors to stuff pinned items onto the start menu. They want the user to do it themselves, which probably explains why they did it this way.

So for the moment, that's the best way of doing it.

(damn) Oh, well. I guess that is why I can't find sh** on how to do it..... Thanks for the information. I really appreciate it!

Share this post


Link to post
Share on other sites

#4 ·  Posted

I have a write up here. Granted, this is for a Windows XP unattended install though, the actual format is in binary, and I haven't really cracked the code yet. One other thing...Microsoft does NOT want software vendors to stuff pinned items onto the start menu. They want the user to do it themselves, which probably explains why they did it this way.

So for the moment, that's the best way of doing it.

Wait, couldn't you just move it to the start menu folder(one with pinned items)? With "FileMove"? Off hand i don't know what folder that is, but it has shorcuts, therefor there has to be a directory holding them.

Just find were on the comp files pinned to start menu are found.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I found a link at http://www.msfn.org/board/index.php?showtopic=89058 regarding programmably pinning a program to the start menu. However, it's in VB using Objects and such. Anyone care to translate to AutoIt? I can't do it myself.....

EDIT: Here's the VB script (cut and pasted):

CODESet objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\Windows\System32")
Set objFolderItem = objFolder.ParseName("calc.exe")

objFolderItem.InvokeVerb("P&in to Start Menu")
Edited by Dougiefresh

Share this post


Link to post
Share on other sites

#6 ·  Posted

Anyone care to translate to AutoIt?

Done

$objShell = ObjCreate("Shell.Application")
$objFolder = $objShell.Namespace("C:\Windows\System32")
$objFolderItem = $objFolder.ParseName("calc.exe")

$objFolderItem.InvokeVerb("P&in to Start Menu")

:)

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Thanks MHz!! Your help is appreciated! Now I can pin stuff to the start menu programmatically!

Wait, couldn't you just move it to the start menu folder(one with pinned items)? With "FileMove"? Off hand i don't know what folder that is, but it has shorcuts, therefor there has to be a directory holding them.

Just find were on the comp files pinned to start menu are found.

Sorry it took me half a year to respond. The Start Menu doesn't have a folder with pinned items. If it did, I wouldn't be having this problem because I could do as you suggested. Unfortunately, the pinned items are stored in the registry. However, the AutoIt code solves the problem that I was having. So thanks everybody for your assistance! Edited by Dougiefresh

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

i know this an old post but i thought i'd put this out there just in case there is someone else looking for a way to pin items to the start menu in vista.

the version previously posted in this thread works but needs a little modification to work with vista.

hope this helpful

this first one is based off the scripting guys.

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\path to your program or link\")
Set objFolderItem = objFolder.ParseName("your program.lnk")

For each Verb in objFolderItem.Verbs()
     If Verb.name = "P&in to Start Menu" Then Verb.DoIt
Next

this second one is the above in autoit

$objShell = ObjCreate("Shell.Application")
$objFolder = $objShell.Namespace("C:\path to your program or link\")
$objFolderItem = $objFolder.ParseName("your program.lnk")

For $val in $objFolderItem.Verbs()
     If $val() = "P&in to Start Menu" Then $val.DoIt()
Next
Edited by tobyb

Share this post


Link to post
Share on other sites

#9 ·  Posted

this dosnt work :D well dont work in windows7 that should be like vista

$objShell = ObjCreate("Shell.Application")
$objFolder = $objShell.Namespace("C:\path to your program or link\")
$objFolderItem = $objFolder.ParseName("your program.lnk")

For $val in $objFolderItem.Verbs()
     If $val() = "P&in to Start Menu" Then $val.DoIt()
Next

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

$objShell = ObjCreate("Shell.Application")
$objFolder = $objShell.Namespace("C:\path to your program or link\")
$objFolderItem = $objFolder.ParseName("your program.lnk")

For $val in $objFolderItem.Verbs()
     If StringInStr($val(), "Start Menu") Then $val.DoIt()
     If StringInStr($val(), "Task Bar") Then $val.DoIt()
Next

epicfail, try this for me, please.

Edited by Manadar

Share this post


Link to post
Share on other sites

#11 ·  Posted

that still dont work it just runs the script then stops it nothing pinned

Share this post


Link to post
Share on other sites

#12 ·  Posted

$objFolder = $objShell.Namespace("C:\path to your program or link\")

am i ment to add the full path to the link or just to the folder its in?

Share this post


Link to post
Share on other sites

#13 ·  Posted

This works in Windows 7:

$objShell = ObjCreate("Shell.Application")
$objFolder = $objShell.Namespace("C:\Windows\System32")
$objFolderItem = $objFolder.ParseName("calc.exe")

For $val in $objFolderItem.Verbs()
    If StringInStr($val(), "Pin to") Then $val.DoIt()
Next

Share this post


Link to post
Share on other sites

#14 ·  Posted

oh sweet thanks what i was doing wrong was adding program.lnk not .exe

Share this post


Link to post
Share on other sites

#15 ·  Posted

how would you unpin a item from the taskbar instead of pinning it?

Share this post


Link to post
Share on other sites

#16 ·  Posted

Check this out:

UDF List:

 

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

 

 

Updated: 02/04/2015

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0