6

This VS2008 artifact is truly bugging me.

I have lived with it in the Start Menu and always use Windows + R, "cmd", Enter to run the regular command prompt - I just don't like VS trappings and prefer a vanilla command prompt.

Well, today it has bugged me for the last time and I tried to remove it from the list (right-click, "Remove from this list") and fired up "cmd" about 15 times in a row. Shock-horror, the shortcut that gets back into the Start Menu (expanded to 30 items) is the "Visual Studio 2008 Command Prompt"!

I just want my old, regular, vanilla command prompt.

Please help.

:EDIT: Start Menu screenshot

Oh look. Stackoverflow is the background.

This screenshot shows the offending menu item in the list (currently position 13 of 15) and the Start->Run window that I use to run "cmd". I removed it, went through and ran "cmd" 15 times and it came back, not as "Command Prompt" but as the VS2008 version.

Ramhound
  • 44,080

3 Answers3

3

Once a program is deemed "worthy" to appear on the front page of the Start menu, Windows selects the most frequently-used shortcut as the one to appear on the front page of the Start menu.

So, for example, say you run cmd.exe 100 times from anywhere (Run box, desktop shortcut, etc.), and Windows determines it is used frequently enough to warrant appearing on the front page of the Start menu. Now, when looking at all of your shortcuts on your Start menu that point to cmd.exe, Windows knows you've used the Visual Studio cmd.exe shortcut once and the one in Accessories zero times, the Visual Studio one is used, because it is the most frequently-used shortcut, even though that's not typically how you run cmd.exe. The rules for this weighting are not public, so we don't know what happens if all shortcuts are used zero times. Some other part of the algorithm would determine that the VS shortcut is the winner.

This explains why, when you run it from Accessories, that shorcut eventually appears instead of the VS one. Eventually might have been once, might have been 10 times. Again, the exact algorithm is a mystery to outside-MS people.

Raymond Chen has a series of blog posts explaining how this works:

What determines which programs show up on the front page of the Windows XP Start menu?

Glorfindel
  • 4,158
0

Does running cmd from the Run... dialog run a normal cmd or a VS cmd?

My guess is that VS2008 has a version of cmd.cmd, cmd.bat, cmd.lnk, cmd.pif or similar in PATH somewhere.

What does where cmd print?

Or is the problem just that the wrong one appears in the Start Menu?

In that case, just type cmd then right click on the normal Command Prompt/cmd entry and then click Pin to Start Menu.

Mikel
  • 9,184
0

You could always just remove the VS command prompt shortcut from the Start Menu as an admittedly kludgey workaround… [Synetech inc]

I'm not sure if Synetech meant to remove it from the Start Menu tree instead of the Most Used list as pictured in the question, but it got me thinking whether this is related to the first program found in the Start Menu tree that corresponds to the program being run (how it detects cmd.exe as the host for the VS bat file is beyond me).

Maybe I had sorted it in such a way that it uses the VS2008 command prompt as the shortcut. So I went to locate Command Prompt in Accessories and ran it. I was planning to run it a few times but lo and behold - the next attempt reveals Command Prompt in the Most Used list!

So the trick is to run it from a start menu shortcut rather than using Start->Run!?