Why won't the CMD window close after Batch fil

2019-03-05 13:11发布

I am trying to execute a file by placing the appropriate command into a batch file. After completing the file execution the command window is not closing automatically. I tried it with the Exit command too but it is not closing the window automatically.

The command in my batch file:

start "" /w /B /d "%CD%\Project-Aug-New\MyCardApi\trunk\src\build\bin" MyCardApiTest_32d.exe
exit 0

3条回答
一纸荒年 Trace。
2楼-- · 2019-03-05 13:37

You can close the console at the end

For example:

   start /b taskkill /F /IM bank01.exe
   ..
   ..
   taskkill /F /IM cmd.exe
查看更多
劳资没心,怎么记你
3楼-- · 2019-03-05 13:50

The /w parameter makes START wait until the process it launches has exited. Remove it:

start "" /B /d ...

This will let your batch file continue running and exit immediately.

查看更多
不美不萌又怎样
4楼-- · 2019-03-05 13:55

Remove the /b (and the /w) from the start command. The /b starts the program in the same window and the /w keeps the window open until the program terminates.

查看更多
登录 后发表回答