NMAKE DDK problems

While setting up the DDK on a new machine, whenever I'd try to build a driver, I'd get this stupid, cryptic error message about nmake failing...

BUILD: Adding /Y to COPYCMD so xcopy ops won't hang.
BUILD: Using 4 child processes
BUILD: Object root set to: ==> objchk_wxp_x86
BUILD: Compile and Link for i386
BUILD: Loading C:\WINDDK\3790~1.183\build.dat...
BUILD: Computing Include file dependencies:
BUILD: Examining c:\drivers\source directory for files to compile.
BUILD: Saving C:\WINDDK\3790~1.183\build.dat...
BUILD: Linking c:\drivers\source directory
BUILD: Exec of 'nmake.exe /nologo BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= 386=1' failed - errno = 0


It turns out that the ComSpec environment variable was set to something other than nothing or the CMD.exe program. In fact, it was set to my cygwin home directory. WTF?

Anyway, the solution was to just delete the ComSpec environment variable. And suddenly my drivers started building again.