Things I Learned Today #1 – where.exe have you been all my life?

Since my memory isn’t what it used to be, I’m going to start blogging anything cool I learn on a given day. Even if nobody reads this it will be a good way for me to create a hit list of cool solutions to problems.

Today’s mad man is the where command on Windows. Here is the description of the command:

Displays the location of files that match the search pattern. By default, the search is done along the current directory and in the paths specified by the PATH environment variable.Command-line help

So why am I so excited about this?

A co-worker was trying to generate service references in a script and wanted to do it in the same way as Visual Studio 2013. He had found svcutil.exe in an SDK directory but when executing it the resulting output wasn’t what he expected. I suspected that it wasn’t the same svcutil.exe that Visual Studio was using and wanted a way to detective out the right one. After a little bit of Google-Fu, I found this post on Stack Overflow. I opened up the Visual Studio 2013 Command Prompt and typed the following command:

C:\Windows\system32>where svcutil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\SvcUtil.exe
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\SvcUtil.exe

Command Prompt

The results show anywhere that svcutil.exe exists based on the PATH variable used by the command prompt.

I used this svcutil.exe and BOOM! The resulting service references were the same as what is produced by Visual Studio 2013.

  2 comments

  1. Greg   •  

    and BOOM!

  2. DaWolf   •  

    That’s BOOMbastic Shaggy!

Leave a Reply

Your email address will not be published. Required fields are marked *