views:

740

answers:

4

I'm looking for a way to make programs appear (frequently) used, so that they would appear in the Start menu's "Recently Used Programs" (after a zero touch install).

I'm trying to figure out how Windows stores information related to program usage frequency.

The only (maybe) related things I can see being changed when I run a program from the Start Menu, are some (seemingly undocumented) BagMRU registry keys which have no meaning to me.

I did found a way to get programs pinned, but that's not what I'm looking for here.

Update: please see the comments for explanation why I would like to do this...

Update2: I'm making progress... Now I know where they keys are stored and I know that the keys are ROT13 "encrypted". And the second 4 bytes of the values are the counter.. http://blog.didierstevens.com/2006/07/24/rot13-is-used-in-windows-you’re-joking/

This ROT13(wikipedia) encryption thing is funny. Well, of course there is a reason. They don't want you to be able to find it by simple search.

Lol, and in windows 7 they are using Vigenère crypto! much better :D

+14  A: 

At the risk of downvotes, this is not something you should be doing. The "Recently Used Programs" belongs to the owner of the computer, not your program.

If your program is as useful as you think it is, it will automagically show up there.

Raymond Chen has done quite a few articles as to why this sort of thing is a bad idea.

This rates among all those other bad ideas such as:

  • how can I force my program to be the handler for certain file types?
  • how can I keep my program always on top.
  • how can I annoy my users by making decisions for them when they previously had the power to make their own decisions as to how their software was configured? :-)

Update:

A couple of things you may want to try.

  • Copy a program (explorer.exe) to axolotl.exe and run it enough times to get it on the list. Then search the registry for it (assuming there's not another axolotl.exe somewhere on your disk).Be aware that some strings are stored as Unicode so it might not be a simple search. It also wouldn't surprise me if MS encoded them some way to make this more difficult.
  • Microsoft's sysinternals have a tool that can monitor the registry (regmon, look here, you could run that while you run a program a few times to see what gets updated when it's added to the list.
paxdiablo
+1 for educating people that are about to do Bad Things™ :) Raymond Chen should be a must-read anyway.
Joey
I know and I agree with you. However my case is different. I only want to do this during deployment(or at first login). After some time that list will reflect what the user actually uses. (More or less your reasoning is why I don't want pinning.)
Kalmi
Fair enough Kalmi, and I'm sorry I don't have a better answer (I actually don't know), but I believe the list should reflect the users choices *all* the time. You've stated that it's only a temporary inconvenience to the user, my argument would be that no inconvenience would be better.
paxdiablo
Why do you need to do this? The first run of your program will probably see it added to the MRU list.
paxdiablo
If it can be done, I suspect Mr Chen (The Old New Thing) would know how. But he'd probably give you the same advice.
paxdiablo
See http://blogs.msdn.com/oldnewthing/archive/2003/09/03/54760.aspx (I'm sure your program isn't one of the "want to be everywhere" variety but it explains why MS would make this difficult, if not impossible to game).
paxdiablo
Pax, we are not talking about my program, we are talking about OS deployment and setting up good defaults in an environment where people usually use a new profile.
Kalmi
@Pax, "no programmatic access to the pin list"... I did found a way to get programs pinned as I stated it in my question, but I don't want no programs pinned (except for what's normally there), because pinned things don't get removed if they are not used(unless explicitly unpinned by the user).
Kalmi
"Pax: You've stated that it's only a temporary inconvenience to the user, my argument would be that no inconvenience would be better." It's not an inconvenience. Do you think the default would be better? :D The defaults: Windows Media Player, Introduction to WinXp, Files and settings transfer wizard
Kalmi
Those are no good defaults when they have all the useful programs pre-installed.
Kalmi
It could be that you can set defaults there using group policies in a normal Windows Server environment.
Joey
Kalmi, if these are your environments you're setting up, then by all means try it. I'm stating why MS will make it exceedingly difficult for you to do. One thought - if the images are all identical, why can't you install, use (to get on the list) then ghost *that* image to all the other PCs?
paxdiablo
I didn't mean to cause offense - I assumed your program was just another one that could be installed and you wanted to add it to the list no matter what. Again, if you're the admin setting up multiple environments, then maybe what you're proposing isn't the bad idea I thought it was.
paxdiablo
No offense taken. I spend a lot of time getting those "useful programs" to behave, so I know what Bad Things are.
Kalmi
Kalmi, see update for a couple of things to try (if you haven't already done so).
paxdiablo
I used to do that "install-use-ghost" thing, but this time I'm not doing image based install. Surprisingly most apps can be installed without any user interaction nowadays quite easily. Getting settings in an unattended way to your (and hopefully the users) preference is not too hard USUALLY either.
Kalmi
A: 

If this is possible, I do recommend against it. It is, as you say, undocumented behaviour and circumvents the intended usage of the frequently used programs list. What's wrong with a desktop icon and quick launch shortcut?

Volte
This would be used in an environment where the machines would be used by a lot of people and each user would have his or her own profile. Most of the time people will use new profiles. This is why we need the first time user experience(defaults) to be good.
Kalmi
A: 

Use Win32 Shell COM interfaces
It has been explained for decades, like for all undocumented features, on Google Groups (Win32), same method than on W95..

All other MRU lists are stored in registry in cleartext and in a different format(no last used date, no usage counter, just a simple ordered list). I don't think that this approach would work here. This seems to be a special case.
Kalmi
A: 

I found what I was looking for here:

http://blog.didierstevens.com/2006/07/24/rot13-is-used-in-windows-you’re-joking/

Kalmi