Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This VS2008 artefact 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 in 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.

share|improve this question

migrated from Feb 21 '11 at 23:35

This question came from our site for professional and enthusiast programmers.

Note to people thinking about voting to re-close this question, read this:… – CanSpice Feb 21 '11 at 19:25
You could always just remove the VS command prompt shortcut from the Start Menu as an admittedly kludgey workaround… – Synetech Feb 22 '11 at 1:17
@Synetech - I have removed it and then run cmd.exe 15 times in a row, as stated in the question – RichardTheKiwi Feb 22 '11 at 1:21
I did’t mean removing it from the frequently-used list of the Start Menu, I meant from the main menu: All Programs->Microsoft Visual Studio 2008->Tools. Drag the shortcut to your desktop to remove it completely from the Start Menu (while not actually deleting it). Now, when you type cmd, it can’t link to the shortcut (actually move the shortcut to a folder on the desktop or somewhere else because items on the desktop are implicitly included in the path). – Synetech Feb 22 '11 at 1:31
up vote 3 down vote accepted

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?

share|improve this answer

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.

share|improve this answer
This is XP - 'where' is not recognized as an internal or external command, operable program or batch file. Also, I don't want to PIN it. I just want to know why it gets replaced with the VS version. cmd runs the vanilla c:\windows\system32\cmd.exe – RichardTheKiwi Feb 22 '11 at 0:59
That’s strange, XP has the where command. Are you using the Home version? – Synetech Feb 22 '11 at 1:16
Which folder should where be in - I don't see it? – RichardTheKiwi Feb 22 '11 at 1:23
Where.exe is in the Visual Studio bin folder. So it will run in a VS2008 cmd window! :) – Steve Fallows Feb 22 '11 at 2:00
@Steve Fallows: So run C:\Windows\System32\cmd.exe and run where inside that command prompt window instead. – Mikel Feb 22 '11 at 2:20

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!?

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .