This is something that I can never tell which one to use. I mean, in the sentence above, it's obvious that it's which, however, when asking someone something is where I get confused. For example, what's correct? What version of vBulletin are you running? Which version of vBulletin are you running?
The second implies a limited number of options, as if the speaker already knows all of the versions released. "What" makes more sense when you are not sure what you are looking for. "Are you using a version below 4.5?" "No." "What version are you using, then?"
This. Though usually I believe it is that grammatically, which would imply a single thing out of an assortment while what is much more general in use. Which would be slightly more appropriate, but both are acceptable.
When you aren't sure how many options there are or what the options are. Which is generally better, but it has an air of "I know what I'm looking for" to it.
This^ Which implies that there is a group and you're asking for a specification. "Which tie should I use?" implies that there are already ties being presented to the listener. "What tie should I use?" is more ambiguous and could be replied with a more general answer like "A blue one." instead of "That one" which you would use with first question.