10

I have a somewhat long-running post-build event (long enough to be annoying to wait for but short enough to be finished after each release compilation) that I want to return immediately to VS. I've tried to run batch files with start but visual studio still waits for the cmd window to close before returning success.

Is there a way to immediately return success when spawning this post-build event?

Thanks.

Max
  • 6,901
  • 7
  • 46
  • 61

3 Answers3

14

This question seems to think that there is a way:

powershell start-process <actual-command-line-to-run>

Haven't tested it myself though.

Community
  • 1
  • 1
MatsT
  • 1,759
  • 3
  • 20
  • 33
  • Can confirm it works - just tested it out by adding a 'pause' command to a batch file - Compilation succeeds while the batch window blocks asking 'Press any key to continue'. Thanks! – Karl Cassar Oct 25 '12 at 10:57
0

Placing for a more direct answer that isn't a workaround, simply type "cmd" as the first line, followed by whatever commands you wish to use.

David Torrey
  • 1,335
  • 3
  • 20
  • 43
0

If you want to use a batch file, you could try the start inside of the batch, or try to place it in the Post-build settings.

Inside of the batch

@echo off
if "%~1"=="async" goto :async
start "" "%~0" async %*
exit /b

:async
...
jeb
  • 78,592
  • 17
  • 171
  • 225