BFCF Posted January 29, 2005 Share Posted January 29, 2005 @BFCFFor my unattended install, the MenuOrder key does not exist at T-12 anyway (see here) so removing the MenuOrder key via cmdlines.txt and a regtweak is futile. This is probably the case for you too. I used this techinique to sort it permanently and unattended too!- jimannyI would like to try your method but honestly i can't see how to make it work... How i launch vbs files? And when? Can you make a tutorial more simple?I would apreciate. Thanks. Link to comment Share on other sites More sharing options...
Sgt_Strider Posted December 23, 2006 Share Posted December 23, 2006 I've been playing around with this issue for a bit now and I'll share what I've learned - hopefully it will help someone.It's been my experience that removing the MenuOrder key does work for a normal install, but only for so long. That is manually install windows, log in, remove the key, and restart. It seems that eventually something happens and it ends up unsorted again.For my unattended install project, I've tried removing the key at T-12 as others have suggested with no luck.Then I came across this at theeldergeek which explains how to sort alphabetically by restricting the permissions on the MenuOrder key. This one has worked great for me for a manual install - now to implement it unattended.Here's what I done which works for me using RegPerm:AlphabetizeStartMenu.vbs:Option Explicit' Usage:' AlphabetizeStartMenu.vbs <drive> <user>' Example:' AlphabetizeStartMenu.vbs D: NewUserdim oWS, oFS, oArgs, regperm, user, drivedim runonceex, menuorder, usersstringset oWS = WScript.CreateObject("WScript.Shell")Set oFS = CreateObject("Scripting.FileSystemObject")set oArgs = WScript.Argumentsdrive = oArgs(0)regperm = drive & "\Tweaks\Tools\regperm.exe /K"user = oArgs(1)runonceex = "\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\"menuorder = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder"usersstring = "/A:Administrators:R /A:" & user & ":R /A:RESTRICTED:R /A:System:F /F /I /Q"'set permissions on MenuOrder key to prevent reordering'these are set with RunOnceEx just after the new user is logged inoWS.RegWrite "HKLM" & runonceex & "Title","Alphabetize the Start Menu"oWS.RegWrite "HKLM" & runonceex & "Flags",20,"REG_DWORD"oWS.RegWrite "HKLM" & runonceex & "install01\","Create MenuOrder Key"oWS.RegWrite "HKLM" & runonceex & "install01\1",drive & "\Tweaks\Tools\CreateMenuOrderKey.vbs"oWS.RegWrite "HKLM" & runonceex & "install02\","Add RegPerm Command Line"oWS.RegWrite "HKLM" & runonceex & "install02\1",regperm & " " & menuorder & " " & usersstringCreateMenuOrderKey.vbsOption Explicitdim oWS, oFSset oWS = WScript.CreateObject("WScript.Shell")Set oFS = CreateObject("Scripting.FileSystemObject")'create MenuOrder keyoWS.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\", "", "REG_SZ"I'm actually calling AlphabetizeStartMenu.vbs from a WIHU interface which comes up using RunOnceEx right after I first logon as administrator. The WIHU command sends the CDROM drive letter it finds and new user name that I create with WIHU. BTW, the WIHU install.ini section looks like this for reference:[Registry Tweaks]selected = 1collapsed = 1description.0 = Keep the Start Menu alphabeticcommand.0 = %SRCDRIVE%\Tweaks\Tools\AlphabetizeStartMenu.vbs %SRCDRIVE% %NewUserName%selected.0 = 1This is working perfect for me now! After I logon as the newly created user, the start menu is perfectly ordered and I am not able to reorder it by dragging. I have not tried this without WIHU but it's my guess that if AlphabetizeStartMenu.vbs <drive> <user> was added to RunOnceEx at T-12 it would work as long as <user> existed at the time of the first logon. Perhaps you could create the user with a batch file and a reg file like here. Then, after you logon again, the MenuOrder key permissions would be set for the user specified.Want to know more? The reason I'm creating the MenuOrder key from AlphabetizeStartMenu.vbs is because I discovered that the key does not exist until after the user is fully logged in - well after RunOnceEx command executes. So basically RegPerm could not set the permissons on a key that did not exist. I discovered this by adding some debug code to the bottom of AlphabetizeStartMenu.vbs:oWS.RegWrite "HKLM" & runonceex & "install03\","Echo Command Line"oWS.RegWrite "HKLM" & runonceex & "install03\1","cmd.exe /k @echo " & regperm & " " & menuorder & " " & usersstringThis basically confirmed that the RegPerm command line was correct during RunOnceEx by showing it in a DOS box. It also prevented RunOnceEx from completing so from the same DOS box, I simply started regedit and found the MenuOrder key was not yet created. Then I closed the DOS box and refreshed regedit every second while windows finished it's startup routines with me logged in as the new user. Guess what - MenuOrder never showed up! But it did show up as soon as I dragged an item around in the start menu. I found this very interesting.As a result, I'm not sure why removing the MenuOrder key at T-12 seems to work for some because for my install, the key already does not exist at that time anyway.I would be happy to know if you found this info useful.The End- jimannyI have a quick question. Are you saying that I should copy those examples into notepad and save it under those file names right? Link to comment Share on other sites More sharing options...
Sgt_Strider Posted February 15, 2007 Share Posted February 15, 2007 bump! Link to comment Share on other sites More sharing options...
Sgt_Strider Posted February 23, 2007 Share Posted February 23, 2007 bump! 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