如何批处理文件执行后自动关闭cmd窗口? [英] How to automatically close cmd window after batch file execution?

查看:2780
本文介绍了如何批处理文件执行后自动关闭cmd窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我跑了有这两条线路的批处理文件:

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)\Xming\Xming.exe" :0 -clipboard -multiwindow

此批处理文件来运行的Xming应用程序,然后腻子应用,所以我可以SSH到我的大学的计算机实验室。

This batch file is used to run the Xming application and then the PuTTY app so I can SSH into my university's computer lab.

但是,如果我运行这个和的Xming尚未打开,一旦从终端的PuTTY我退出cmd窗口保持打开状态。只有当我已经运行的Xming确实当我关闭腻子终端cmd窗口关闭。我试着加入退出到批处理文件的最后一行,但无济于事。

However, if I run this and Xming is not already open, once I exit from the PuTTY terminal the cmd window remains open. Only if I have already run Xming does the cmd window close when I close the PuTTY terminal. I've tried adding exit to the last line of the batch file, but to no avail.

推荐答案

修改该批处理文件开始这两个程序,而不是开始 ING之一,呼叫 ING另一个

Modify the batch file to START both programs, instead of STARTing one and CALLing another

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

如果你运行它这样的,没有CMD窗口将停留在启动程序后打开。

If you run it like this, no CMD window will stay open after starting the program.

这篇关于如何批处理文件执行后自动关闭cmd窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆