set DSSS_PATH=c:\dsss dmd -c -H -I%DSSS_PATH%\include\d -L%DSSS_PATH%\lib activex.d if ERRORLEVEL 1 goto error lib -c activex.lib activex.obj if ERRORLEVEL 1 goto error echo "Build complete" goto exit :error echo Last cmd failed(%ERRORLEVEL%), this build is not complete ... :exit