Jump to content

Recommended Posts

Posted

Hi guys

 

I was just wondering is there a script that will sort the shortcuts on the start menu by the name so they are all nice and tidy when the user logs on and they are not all over the place. When we have different software on different machines if I user logs on the a machine and software is on the start menu that wasn’t there before it puts it to the bottom.

 

Thanks

Posted

Time to learn a bit of scripting me thinks. I will give you some hints though:

It will be a logon script and you should look at the "reg" DOS command to add to a batch script or you can do the same in VB script but that will be 2 or 3 lines.

Posted

This script will achieve that, it deletes the 'menuorder' string in the registry. I found the basics on a scripting site, but it needed a slight modification to make it work for this. I've no idea how it will perform in a networked environment, it works reliably on my PC at home.

 

Copy and paste into notepad, and save as a .VBS file. This is fairly un-tested so use it at your own risk! Modifying registry entries can cause problems, and this script COULD wipe your entire registry if you used it wrong! don't say you wern't warned!

 

'*******Begin script********* 
On Error Resume Next 

Const HKCU = &H80000001 

strComputer = "." 
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder" 

Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv") 

DeleteSubkeys HKCU, strKeypath 

Sub DeleteSubkeys(HKCU, strKeyPath) 
objRegistry.EnumKey HKCU, strKeyPath, arrSubkeys 
If IsArray(arrSubkeys) Then 
For Each strSubkey In arrSubkeys 
DeleteSubkeys HKCU, strKeyPath & "\" & strSubkey 
Next 
End If 
objRegistry.DeleteKey HKCU, strKeyPath 
End Sub 
'*******End Script******* 

 

Mike.

Posted

Good lord, all that for a simple registry entry !!

This is one of the reasons I avoid any VBS scripting..... 15 lines of code when a batch or AutoIT script could do it in two to three lines.

Posted
sorry but im not a script expert

 

You are a young chappy, now is a good time to learn - open up a command prompt and type in:

 

reg delete /?

 

This will give you a breakdown of how to delete the menu order key as stated on the link provided by Iain.

Posted

Ok please bare with me on this, would i put this in the batch file?

 

REG DELETE HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder
Posted

ok so were abouts does the /f go please? Like this

 

Thanks

 

REG DELETE HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder /f
Posted

I prefer VB script, as it executes faster in my experience, plus all my other scripts are in VB script so it makes sense to use VB script for everything ,as I can bung it all in one script. I also find VB script more flexible. Personal preference type of affair really.

 

Mike.

Posted

Yep, the /f goes at the end.

 

Visit:

 

http://www.robvanderwoude.com/

 

For some tips etc. But like Maniac says, you will end up prefering a scripting language of your choice and one you feel more comfortable with. For me its AutoIT & good old fashioned batch files. Maniac likes VB [ maybe thats why he is called Maniac.... ;-) ] only joking Mike.....

Posted

Worked for me, did you log off and back on again or re-boot ?

Also did you work your way into regedit to check that the key was actually deleted ?

 

[ Remember it gets re-created after the logon / reboot ]

Posted

Maybe try running it as a logoff script, so the next time a user logs on the key is recreated and the menu order is reset.

 

Iain.

Posted
I prefer VB script, as it executes faster in my experience, plus all my other scripts are in VB script so it makes sense to use VB script for everything ,as I can bung it all in one script. I also find VB script more flexible. Personal preference type of affair really.

 

Mike.

 

If you could put up a copy I'd be forever grateful, sick of having to re-order it on each machine. Though I have seen on my Vista box that as soon as you add anything to the start menu, it organises it by name. If that is a registry setting then that could probably be applied to great effect in this scenario.

Posted

it's on the previous page. :)

 

I personally don't use this code so I don't know if it works in practice, but it does remove the start menu order registry key which, when tested, re-orders the start menu by name on my home desktop, so there's no reason it shouldn't work.

 

Personally I use a mandatory profile for students on the network which has had this registry key removed, so the start menu is always ordered by name by default.

 

Mike.

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



×
×
  • Create New...