I love bash.
I hate cmd.exe. This is mostly due to unfamiliarity, but I don’t care, I hate regardless.
Enter, me configuring cc.net and msbuild complaining about a version 10, Visual Studio 2008, sln file. This is because the msbuild that cc.net knows about is the 2005 msbuild. So I fire up a 2008 Command Prompt run msbuild, and everything runs fine.
Now it seems like the “Microsoft way” would be for me to examining the path manually, go trouncing through the directories in this path, looking for msbuild. WTF??? I don’t work that way.
In Linux, there is a command called which, which will tell you which command you are executing if you type it at the prompt. All it does is search your path, in order, to tell you which command would run if you actually type a command. The exception is shell built-ins, but lets ignore that.
[jrwren@utonium:$] which ls
It turns out this is TRIVIAL to write as a batch file. cmd.exe has the goods for you. I’m writing this here because MS keeps changing urls on me and my del.icio.us links don’t work anymore.
Maybe this link won’t change.
Pretty slick eh?
IMNSHO this should be in every windows directory on every windows computer everywhere 🙂 Its 2008. I’ve been living with which in linux/unix since I started using it in 1995. Please step into 13 years ago by copying this batch file to all of your windows computers.