Why won't the CMD window close after Batch file execution?

后端 未结 3 1613
时光取名叫无心
时光取名叫无心 2021-01-25 17:26

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

相关标签:
3条回答
  • 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.

    0 讨论(0)
  • 2021-01-25 18:13

    You can close the console at the end

    For example:

       start /b taskkill /F /IM bank01.exe
       ..
       ..
       taskkill /F /IM cmd.exe
    
    0 讨论(0)
  • 2021-01-25 18:15

    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.

    0 讨论(0)
提交回复
热议问题