How to automatically close cmd window after batch file execution?

后端 未结 8 1629
半阙折子戏
半阙折子戏 2020-11-30 23:47

I\'m running a batch file that has these two lines:

start C:\\Users\\Yiwei\\Downloads\\putty.exe -load \"MathCS-labMachine1\"
\"C:\\Program Files (x86)\\Xmi         


        
8条回答
  •  一个人的身影
    2020-12-01 00:11

    If you want to separate the commands into one command per file, you can do

    cmd /c start C:\Users\Yiwei\Downloads\putty.exe -load "MathCS-labMachine1"
    

    and in the other file, you can do

    cmd /c start "" "C:\Program Files (x86)\Xming\Xming.exe" :0 -clipboard -multiwindow
    

    The command cmd /c will close the command-prompt window after the exe was run.

提交回复
热议问题