0

I have tried piping the following two calls to NUL with no luck:

net stop "Logging Service">nul 2>&1
taskkill /IM LogServiceHost.exe /f >nul 2>&1

They will stop my build cycle from going through:

Error   1   The command "
net stop "Logging Service">nul 2>&1
taskkill /IM LogServiceHost.exe /f >nul 2>&1" exited with code 128. LoggingUtilities

Any ideas how I can just fire these prebuild events and not care what they return, and not have it ever suppress my build?

Alexandru
  • 12,264
  • 17
  • 113
  • 208

1 Answers1

2

Try adding the following line at the end of your post-build event. This should cause the automatically-generated .bat script to return an ERRORLEVEL 0.

exit /b 0
Michael Gunter
  • 12,528
  • 1
  • 24
  • 58
  • Problem with this is that I may have errors from commands I include above these two that I still want it to prevent building in case they occur. What would I do in that case? – Alexandru Jun 26 '13 at 16:51
  • 1
    Learn batch scripting. :) After every line at which you want to stop the post-build if an error occurs, you need to check ERRORLEVEL. Something like `if errorlevel 1 exit /b 1` would do. – Michael Gunter Jun 26 '13 at 16:56