Monday, December 7, 2009

Vista: Programmatically Adding the 'Run' Command to the Start Menu

For a user, adding the 'run' command to the start menu is easy process. However, developers need a way to automate this process. Thankfully, there is a single registry entry that will add the run command to the vista start menu for all users.

HKLM\Software\Microsoft\CurrentVersion\explorer\Advanced. Change the value of "Start_ShowRun" to "1". If it doesn't exist, create the value name and set the value to "1". Voila!

For the C# developers (formatting courtesy of Manoli.net)


   1:  //Add run command to Start menu
   2:  RegistryKey runKey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\explorer\Advanced", true);
   3:  runKey.SetValue("Start_ShowRun", 1, RegistryValueKind.DWord);

No comments:

Post a Comment