Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

People in my office often ask me 'how do I run those tests?'. I tell them, browse to the Build folder, open a command prompt, and run msbuild /t:Tests.

That works for me, because msbuild is in my path

> where msbuild.exe

However it doesn't work for everyone else, because they might not have that folder in their path. Explaining how to change that is tedious.

Is it possible to make the command work for everyone, even if they don't have the folder in their path?

I'm imagining a file msbuild.cmd in the Build folder that fixes the problem. It would run the real msbuild.exe with the same arguments (it's not always /t:Tests). It would first look in the path for msbuild.exe, then in C:\Windows\Microsoft.NET\Framework\v4.0.30319.

share|improve this question
Sure...Just tell them the full path of the exe and include that in the command you tell them. Infact forget about the path file if you simply did C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /t:Tests it does what you want. – Ramhound May 31 '13 at 15:38

Went with

@echo off
REM This shim helps anyone who doesn't have msbuild in their path.

for %%X in (msbuild.exe) do (
    msbuild.exe %*
    exit /b

echo "You should probably add msbuild to your path."

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" %*
exit /b
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.