• Announcements

    • xper

      MSFN Sponsorship and AdBlockers!   07/10/2016

      Dear members, MSFN is made available via subscriptions, donations and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, become a site sponsor and ads will be disabled automatically and by subscribing you get other sponsor benefits.
Sign in to follow this  
Followers 0
linkking

Pin to Startmenu in closed environment

2 posts in this topic

Hi

I 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] keys

The rule is ONLY SHORTCUTS initiated from the desktop or the programdata folder

will 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] key

The actual executable file these shortcuts are pointing to is in the other key

CEBFF5CD-ACE2-4F4F-9178-9926F41749EA

The counters are in the binary data, and by manipulating these values to high

numbers 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 counters

Userassistview

Since desktop is a "current user" destination folder, i made a batchscript that

collects the %USERNAME% and converts it to Rot13 and writes it to a regfile that

gets 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 enabledelayedexpansion

set input=%USERNAME%

set "upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ"

set "upmap=NOPQRSTUVWXYZABCDEFGHIJKLM"

set "lomap=nopqrstuvwxyzabcdefghijklm"

set "step=%input:!=^!%"

:rotloop

if 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.reg

ECHO. >> ASSIST.reg

ECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{F4E57C4B-2036-45F0-A9AB-443BCFE33D9F}\Count] >> ASSIST.reg

ECHO "P:\\Hfref\\!out!\\Qrfxgbc\\Zbmvyyn Sversbk.yax"=hex:00,00,00,00,02,05,01,00,\ >> ASSIST.reg

ECHO 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.reg

ECHO 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.reg

ECHO ff,ff,00,2c,d7,7f,70,66,cc,01,00,00,00,00 >> ASSIST.reg

ECHO. >> ASSIST.reg

ECHO [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{CEBFF5CD-ACE2-4F4F-9178-9926F41749EA}\Count] >> ASSIST.reg

ECHO "U:\\Zbmvyyn Sversbk.rkr"=hex:00,00,00,00,02,05,01,00,02,05,ff,00,00,00,00,00,\ >> ASSIST.reg

ECHO 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.reg

ECHO 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.reg

ECHO cc,01,00,00,00,00 >> ASSIST.reg

REGEDIT /S ASSIST.reg

del ASSIST.reg

Clearcache.exe

cls

Red color = variable with Rot13 encoded username

Green color = 66818 times executed

Blue color = 65280 times executed

Orange color = 16712962 Focus counter

Edited by linkking
0

Share this post


Link to post
Share on other sites

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 Script


Const CSIDL_COMMON_PROGRAMS = &H17
Const CSIDL_PROGRAMS = &H2
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") Then
wscript.quit
End If
Set 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
Next

2.Then manipulate the pinned Calculator shortcut that gets created here:

C:\Users\USERNAME\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu\Calculator.LNK

to 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") Then
wscript.quit
End If
Set 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.Save

Set 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! :thumbup

Edited by linkking
0

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

  • Recently Browsing   0 members

    No registered users viewing this page.