Sort Start -> Programs from command line

E

ever90321

Hello,

I've done numerous web and usenet searches over the past few days and
come up short, and am hoping now to get somebody's input...

I am not a C programmer, but am looking for a registry or command line
technique, or a small 3rd party command line tool that performs the
right-click -> Sort By Name feature on the Windows XP Programs menu.
(Or similarly, the "Taskbar and Start Menu Properties" Control Panel's
Sort button.) It would obviously be helpful if it worked for newer
OS's, too. From what I can tell, there is no built-in way to do this,
without performing additional work like rebooting the computer. I
also found a VBS script that does an actual (bubble?) sort on the
shortcuts, which is also something I want to avoid. From using
SysInternals' Process Monitor, the best I can tell is that the Sort
functionality is built into explorer.exe, but I have no idea if this
API call is even exposed for programmers.

Any suggestions?

Thanks,
Todd
 
B

Bob CP

Hello,

I've done numerous web and usenet searches over the past few days and
come up short, and am hoping now to get somebody's input...

I am not a C programmer, but am looking for a registry or command line
technique, or a small 3rd party command line tool that performs the
right-click -> Sort By Name feature on the Windows XP Programs menu.
(Or similarly, the "Taskbar and Start Menu Properties" Control Panel's
Sort button.) It would obviously be helpful if it worked for newer
OS's, too. From what I can tell, there is no built-in way to do this,
without performing additional work like rebooting the computer. I
also found a VBS script that does an actual (bubble?) sort on the
shortcuts, which is also something I want to avoid. From using
SysInternals' Process Monitor, the best I can tell is that the Sort
functionality is built into explorer.exe, but I have no idea if this
API call is even exposed for programmers.

Any suggestions?

Thanks,
Todd
If all else fails, you can make an exe from an Autohotkey script.
 
E

ever90321

If all else fails, you can make an exe from an Autohotkey script.


Or AutoIt? But this would still involve opening some window, I think,
which is less than professional / ideal.
 
B

boatman312

Or AutoIt? But this would still involve opening some window, I think,
which is less than professional / ideal.

Autohotkey has the ability to hide a window too. Still, a Mickey Mouse
solution, but if no one comes up with a better solution...
 
M

Marcello

As workaround you could kill explorer.exe after having deleted the
registry-key.
(Being killed by script explorer.exe restarts automatically.)

Lg
Marcello
 
E

ever90321

On 5/24/2010 8:31 AM, (e-mail address removed) wrote:
[...]

This shows the registry changes more clearly:

http://samanathon.com/registry-hack-automatically-sort-the-programs-m...
-----------

and this discusses the security API used to change registry key permissions:

http://www.xtremevbtalk.com/showthread.php?t=78240

In answer to your question, it is possible but requires the use of the
security api function. Unfortunately these are some of the more arcance
functions in the API. I haven't the time to run up an example for you,
however you should use MSDN to check out these functions:

RegSetKeySecurity
SetEntriesInACL

Of course, you need to be able to open the key to set these ACEs so your
program will need to be run from an administrative account first in
order to set the necessary access.
-----------

I recommend you post this in a newsgroup for whatever programming
language you are going to use and write a program that you can run from
the command line.

Mike

--- news://freenews.netfront.net/ - complaints: (e-mail address removed) ---

Thanks for all the replies, but there may have been a
misunderstanding. I don't want the Programs menu sorting itself
automatically forever, but only on cue, each time I run
"sortprograms.exe". It's looking more likely there's no registry or
OS trick for that, eh? But is there a way to link directly to the
"Sort" / "Sort by Name" functionality in explorer.exe (?) and avoid
all this messiness? I am not a C programmer (for a small,
straightforward program, it wouldn't be an impossible leap) and was
hoping/guessing that such a program must already exist somewhere.
Second takes anyone?

Thanks again,
Todd
 
E

ever90321

Todd,

Sorry for the misunderstanding. I haven't seen anything that would do
what you're asking for. Would you mind explaining the application... is
this something you'd be running just to save time, or is it a feature
you want to add to a program you're installing or running?

Mike

--- news://freenews.netfront.net/ - complaints: (e-mail address removed) ---

It's meant to add some polish to a remote device management server.
Once a program (.exe, .msi, etc.) is installed over-the-air on the
laptop, "sortprograms.exe" would run once. I suppose it would be
possible to set each laptop to always sort Start -> Programs
automatically (or just let the folders fall where they may), but I
find this the cleanest solution. I'm often surprised at the features
lying under the surface of Windows when I go digging, but this seems
to be something that was left out.

If you or anyone has other suggestions, please let me know.
Autohotkey is looking pretty good right now! ;)
 
J

jmatt

Hello,

I've done numerous web and usenet searches over the past few days and
come up short, and am hoping now to get somebody's input...

I am not a C programmer, but am looking for a registry or command line
technique, or a small 3rd party command line tool that performs the
right-click -> Sort By Name feature on the Windows XP Programs menu.
(Or similarly, the "Taskbar and Start Menu Properties" Control Panel's
Sort button.)  It would obviously be helpful if it worked for newer
OS's, too.  From what I can tell, there is no built-in way to do this,
without performing additional work like rebooting the computer.  I
also found a VBS script that does an actual (bubble?) sort on the
shortcuts, which is also something I want to avoid.  From using
SysInternals' Process Monitor, the best I can tell is that the Sort
functionality is built into explorer.exe, but I have no idea if this
API call is even exposed for programmers.
Sort Menus Alphabetically
http://www.theeldergeek.com/sort_menus_alphabetically.htm

Menu Sorter
http://www.cooltoys.org.uk/products/menu_sorter/
 
E

ever90321

I emailed the cooltoys guy asking for the source code, I may be able to
write a small Visual Basic 6 app that did the job that doesn't open any
windows, just runs, does the sort, then closes itself. If he gives me
the source code I'll write the app and test it on my XP machine and let
you know if I get it working.

--- news://freenews.netfront.net/ - complaints: (e-mail address removed) ---

Mike,

Wow, I really appreciate the help. I am in the process of contacting
James @ Cooltoys myself. His program sort of does what I want, with
the exception of a /silent switch as you noted. The other problem?
It does't work so well. I tried dragging a single folder out of place
and running Menu Sorter, and it generally does nothing at all. This
is on a WinXP SP3 computer...no telling what effect it has on Vista or
7. I am curious what James has to say about this. If at its heart,
Menu Sorter is simply a dog, then the source code won't make much
difference. The final problem, which I'm sure is just bad luck, is
that the line of A-Squared/Ikarus malware detectors flag it as
containing Trojan-Downloader.Win32.VB!IK. I checked the program at
http://www.virustotal.com and http://virusscan.jotti.org/en, and these
are the *only* programs to flag it, and I also ran my own tests that
judge it as clean.

Thanks,
Todd
 
M

mscir

Mike,

Wow, I really appreciate the help. I am in the process of contacting
James @ Cooltoys myself. His program sort of does what I want, with
the exception of a /silent switch as you noted. The other problem?
It does't work so well. I tried dragging a single folder out of place
and running Menu Sorter, and it generally does nothing at all. This
is on a WinXP SP3 computer...no telling what effect it has on Vista or
7. I am curious what James has to say about this. If at its heart,
Menu Sorter is simply a dog, then the source code won't make much
difference. The final problem, which I'm sure is just bad luck, is
that the line of A-Squared/Ikarus malware detectors flag it as
containing Trojan-Downloader.Win32.VB!IK. I checked the program athttp://www.virustotal.comandhttp://virusscan.jotti.org/en, and these
are the *only* programs to flag it, and I also ran my own tests that
judge it as clean.

Thanks,
Todd

Here's the reply from James, who released the Cool Toys sort program:

------------------------------------------------------------------------------------------------------
From: James (Cool Toys) <[email protected]>
Subject: Re: Cool Toys - Contact Form - would you mind making the
source code available
To: "Mike Scirocco" <[email protected]>
Date: Thursday, May 27, 2010, 12:41 PM

Hi Mike,

The Menu Sorter utility is a bit crude really, as all it does it
delete
everything under this registry key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
\MenuOrder

Which is what Windows uses to store the sort order - I seem to
remember
Windows doesn't re-read the values from the registry all of the time
though, i.e. rebooting may be necessary for the changes to be picked-
up.

Hope that helps

James
------------------------------------------------------------------------------------------------------

Is this an approach you want to try, and if so do you require a VB
program to accomplish it?

Mike
 
E

ever90321

On May 27, 10:51 am, (e-mail address removed) wrote:



Here's the reply from James, who released the Cool Toys sort program:

------------------------------------------------------------------------------------------------------
From: James (Cool Toys) <[email protected]>
Subject: Re: Cool Toys - Contact Form - would you mind making the
source code available
To: "Mike Scirocco" <[email protected]>
Date: Thursday, May 27, 2010, 12:41 PM

Hi Mike,

The Menu Sorter utility is a bit crude really, as all it does it
delete
everything under this registry key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
\MenuOrder

Which is what Windows uses to store the sort order - I seem to
remember
Windows doesn't re-read the values from the registry all of the time
though, i.e. rebooting may be necessary for the changes to be picked-
up.

Hope that helps

James
------------------------------------------------------------------------------------------------------

Is this an approach you want to try, and if so do you require a VB
program to accomplish it?

Mike

Hey, James sent me a copy of that email as well. But unfortunately I
was trying that days before I posted here, and it doesn't work. At
least it doesn't work instantly, like clicking "Sort" or "Sort by
name" within Windows XP, which is what I'm trying to do. I forget
which board it came from, but someone else suggested
http://www.lujosoft.net/_content/_utilities/AutoSortMenu.html. This
seems like a further step backward, though, because not only does it
not work instantly, but as a .NET program it requires an outright
installation, and I'm trying to stay within a small footprint. I do
want to contact the LuJuSoft guy, in case he has any ideas.

To recap, the problem is that while Windows probably also deletes the
\Menu or \Menu2 key in the registry, it likely triggers an instant
rebuild of the key, which is otherwise requires by a reboot. I'm
looking for the API to do that without rebooting, if it's even
possible. I'll post again the next time I have news.

Thanks!
Todd
 
M

Mike S

Hey, James sent me a copy of that email as well. But unfortunately I
was trying that days before I posted here, and it doesn't work. At
least it doesn't work instantly, like clicking "Sort" or "Sort by
name" within Windows XP, which is what I'm trying to do. I forget
which board it came from, but someone else suggested
http://www.lujosoft.net/_content/_utilities/AutoSortMenu.html. This
seems like a further step backward, though, because not only does it
not work instantly, but as a .NET program it requires an outright
installation, and I'm trying to stay within a small footprint. I do
want to contact the LuJuSoft guy, in case he has any ideas.

To recap, the problem is that while Windows probably also deletes the
\Menu or \Menu2 key in the registry, it likely triggers an instant
rebuild of the key, which is otherwise requires by a reboot. I'm
looking for the API to do that without rebooting, if it's even
possible. I'll post again the next time I have news.

Thanks!
Todd

Have you seen this:

http://www.itechtalk.com/thread1691.html

using a batch file.

Mike
 
E

ever90321

Have you seen this:

http://www.itechtalk.com/thread1691.html

using a batch file.

Mike

Yes, I did come across that earlier, or something similar. I
originally wanted to avoid a full sort routine, as I wasn't sure it
how it would work on later OS's, or if it would run into any
permission issues...but then I never read the whole article. At this
point, I should probably have another look. :)

Todd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top