Who writes this stuff?

If, for some reason, I append “.exe” to devenv, when running a command line build in a batch file, the build runs but is completely silent.

If I copy and paste that same command into a regular command prompt window, it returns immediately and the build happens silently in the background.

If I don’t put .exe on the end of the command line, in both cases it runs in the foreground with full build output to the console.

Who writes crap software like this?

"C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv"  C:\work\everything\everything.sln /build

vs

"C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.exe"  C:\work\everything\everything.sln /build
This entry was posted in tech. Bookmark the permalink.

2 Responses to Who writes this stuff?

  1. Ari Pernick says:

    Without specifying the .exe you get subjected to extension ordering, things like .bat and .cmd run before .exe and .com. In this case .com is running before .exe. The .exe is the non console executable that runs the IDE. The .com version, I would bet, is a little trick to see if this is something that should run in the command line or not. If it’s a build, don’t invoke the IDE, and run the build, if it’s not to do some build then go ahead and launch the IDE. When you append the .exe you avoid this sniffing and force the IDE to handle it. Simular to launching stuff like notepad the window is async to the command line that launched it. Hence it “runs in the background” and returns immediately.

    The soln is to not hardcode devenv.exe, hardcode devenv.com

  2. jason weber says:

    Ari is close… You shouldn’t specify an extension, you should allow Windows to map to the appropriate executable. The .com file is a shim over devenv.exe that routes i/o to and from the command window. Your scripts should just called devenv and their things will happen.

    - jason weber Microsoft