How to close the command line window after running a batch file?
Your code is absolutely fine. It just needs "exit 0" for a cleaner exit.
tncserver.exe C:\Work -p4 -b57600 -r -cFE -tTNC426B
exit 0
It should close automatically, if it doesn't it means that it is stuck on the first command.
In your example it should close either automatically (without the exit
) or explicitly with the exit
. I think the issue is with the first command you are running not returning properly.
As a work around you can try using
start "" tncserver.exe C:\Work -p4 -b57600 -r -cFE -tTNC426B