简体   繁体   English

如何在执行单独的节点进程后自动关闭 cmd window

[英]How to automatically close the cmd window after executing a seperate node process from it

I'm using a batch file to schedule a.js bot.我正在使用批处理文件来安排 a.js 机器人。 The bot is exiting his process after he is done with his job but using the batch cmd window as log output.机器人在完成工作后退出他的进程,但使用批处理 cmd window 作为日志 output。

I'm using process.exit(1) to exit his process.我正在使用process.exit(1)退出他的进程。

My problem now is that the cmd window wont close automatically but needs an input to do so:我现在的问题是 cmd window 不会自动关闭,但需要输入才能这样做:

Press Enter or Esc to close console...

batch script:批处理脚本:

cd "[path]"
node bot.js
exit

Problem solved!问题解决了!

Thanks to Anon Coward for his/her advice, the settings of ConEmu screwed me over.感谢 Anon Coward 的建议,ConEmu 的设置让我大吃一惊。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM