linkking Posted August 31, 2011 Share Posted August 31, 2011 (edited) HiI got a situation where the rightclick option "Pin to Startmenu"has been disabled for non native windows apps.(Corporate environment)Next best thing?Make your application stick just underneath the pinned apps and not"trickle down" the start list, but always be on top.The position in this list is governed by several counters in the [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{F4E57C4B-2036-45F0-A9AB-443BCFE33D9F}\Count]&[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{CEBFF5CD-ACE2-4F4F-9178-9926F41749EA}\Count] keysThe rule is ONLY SHORTCUTS initiated from the desktop or the programdata folderwill show up in this list, and they are located under the [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{F4E57C4B-2036-45F0-A9AB-443BCFE33D9F}\Count] keyThe actual executable file these shortcuts are pointing to is in the other keyCEBFF5CD-ACE2-4F4F-9178-9926F41749EAThe counters are in the binary data, and by manipulating these values to highnumbers one effectively pushes the shortcuts to the top of the list.You can use the Userassistview app to decode these entries as they are encoded in Rot13,and get a view of the countersUserassistviewSince desktop is a "current user" destination folder, i made a batchscript thatcollects the %USERNAME% and converts it to Rot13 and writes it to a regfile thatgets applied with the manipulated binary values.I then execute a pinvoke to refresh the startmenu.(Clearcache.exe)Pinvoke(So you don't need to logout or kill explorer for the changes to take place)In this example i'm pushing Mozilla Firefox.Ink on the desktop, that's pointing to Mozilla Firefox.exe installed in the root of F: to the top of the startmenu (Rot13.bat)@echo off&setlocal enabledelayedexpansionset input=%USERNAME%set "upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ"set "upmap=NOPQRSTUVWXYZABCDEFGHIJKLM"set "lomap=nopqrstuvwxyzabcdefghijklm"set "step=%input:!=^!%":rotloopif defined step ( set "isletter=false" for /l %%x in (0,1,25) do ( if /i "!step:~0,1!"=="!upper:~%%x,1!" ( if "!step:~0,1!"=="!upper:~%%x,1!" ( set "out=!out!!upmap:~%%x,1!" ) else ( set "out=!out!!lomap:~%%x,1!" ) set "isletter=true" ) ) if "!isletter!"=="false" ( set "out=!out!!step:~0,1!" ) set "step=!step:~1!" goto rotloop)ECHO Windows Registry Editor Version 5.00 > ASSIST.regECHO. >> ASSIST.regECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{F4E57C4B-2036-45F0-A9AB-443BCFE33D9F}\Count] >> ASSIST.regECHO "P:\\Hfref\\!out!\\Qrfxgbc\\Zbmvyyn Sversbk.yax"=hex:00,00,00,00,02,05,01,00,\ >> ASSIST.regECHO 00,00,00,00,00,ff,00,00,00,00,80,bf,00,00,80,bf,00,00,80,bf,00,00,80,bf,00,\ >> ASSIST.regECHO 00,80,bf,00,00,80,bf,00,00,80,bf,00,00,80,bf,00,00,80,bf,00,00,80,bf,ff,ff,\ >> ASSIST.regECHO ff,ff,00,2c,d7,7f,70,66,cc,01,00,00,00,00 >> ASSIST.regECHO. >> ASSIST.regECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{CEBFF5CD-ACE2-4F4F-9178-9926F41749EA}\Count] >> ASSIST.regECHO "U:\\Zbmvyyn Sversbk.rkr"=hex:00,00,00,00,02,05,01,00,02,05,ff,00,00,00,00,00,\ >> ASSIST.regECHO 00,00,80,bf,00,00,80,bf,00,00,80,bf,00,00,80,bf,00,00,80,bf,00,00,80,bf,00,\ >> ASSIST.regECHO 00,80,bf,00,00,80,bf,00,00,80,bf,00,00,80,bf,ff,ff,ff,ff,00,2c,d7,7f,70,66,\ >> ASSIST.regECHO cc,01,00,00,00,00 >> ASSIST.regREGEDIT /S ASSIST.regdel ASSIST.regClearcache.execlsRed color = variable with Rot13 encoded usernameGreen color = 66818 times executedBlue color = 65280 times executedOrange color = 16712962 Focus counter Edited September 6, 2011 by linkking Link to comment Share on other sites More sharing options...
linkking Posted September 6, 2011 Author Share Posted September 6, 2011 (edited) I found a way to pin "non-pinnable" apps.That is, on systems that allow pinning, but the option is missing from the context menu on particular items, exe files etc.Here's how.1.Pin an object that has the verb "Pin to Start Menu" in it's context menu(Calculator for example)This can be done thru a simple vbs script:Pin Items to the Start Menu or Windows 7 Taskbar via ScriptConst CSIDL_COMMON_PROGRAMS = &H17 Const CSIDL_PROGRAMS = &H2Set fso = CreateObject("Scripting.FileSystemObject")Set sh = CreateObject("WScript.Shell")Set oEnv = sh.Environment("Process")sProfile = oEnv.Item("UserProfile")If fso.FileExists(sProfile &"\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Mozilla Firefox.lnk") Thenwscript.quitEnd IfSet objShell = CreateObject("Shell.Application") Set objAllUsersProgramsFolder = objShell.NameSpace(CSIDL_COMMON_PROGRAMS) strAllUsersProgramsPath = objAllUsersProgramsFolder.Self.Path Set objFolder = objShell.Namespace(strAllUsersProgramsPath & "\Accessories") Set objFolderItem = objFolder.ParseName("Calculator.lnk") Set colVerbs = objFolderItem.Verbs For Each objVerb in colVerbs If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then objVerb.DoIt Next2.Then manipulate the pinned Calculator shortcut that gets created here:C:\Users\USERNAME\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Calculator.LNKto point to your desired target:(In this example i'm pointing to Mozilla Firefox.exe that's located in the root of F:)Set fso = CreateObject("Scripting.FileSystemObject")Set sh = CreateObject("WScript.Shell")Set oEnv = sh.Environment("Process")sProfile = oEnv.Item("UserProfile")If fso.FileExists(sProfile &"\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Mozilla Firefox.lnk") Thenwscript.quitEnd IfSet shortcut = sh.CreateShortcut(sProfile &"\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Calculator.LNK")shortcut.TargetPath = "H:\Mozilla Firefox.exe"shortcut.Arguments = ""shortcut.Description = ""shortcut.IconLocation = "H:\Mozilla Firefox.exe, 0"shortcut.WorkingDirectory = "H:"Wscript.Sleep(1000)shortcut.SaveSet oFile = fso.GetFile(sProfile &"\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Calculator.LNK") oFile.Name = "Mozilla Firefox.lnk"Voi'la your un-pinnable application is now pinned! Edited September 6, 2011 by linkking Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now