通过.BAT插入命令,在已经打开CMD [英] Insert command in already open CMD through a .bat

查看:299
本文介绍了通过.BAT插入命令,在已经打开CMD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I codeD一个网站,我的朋友可以启动和关闭了PHP的服务器的Minecraft。要停止他们的服务器,一个.bat文件杀死的过程中,但通常的Minecraft服务器将使用停止命令停止。在我的世界服务器在运行CMD所以我的问题是:

I coded a website where my friends can start and close their Minecraft server over PHP. To stop their server, a .bat file kills the process, but normally Minecraft servers will be stopped with the "Stop" command. The Minecraft server is running in a CMD and so my question is:

是否有可能从开始.BAT到一个单独的,已经打开CMD,使得已经打开CMD停止服务器?

Is it possible to send a command from a started .bat to a separate, already open CMD so that the already open CMD stop the Server?

推荐答案

可以的发送键到控制台 - 但最终你需要知道命令提示符窗口的名称。检查准备使用 sendKeys.bat

You can send keys to the console - but eventually you'll need to know the name of the command prompt window. Check the ready to use sendKeys.bat :

call sendKeys.bat "command prompt" "stop{ENTER}"

在案件的称号只是命令提示符 - 它可能是不同的,所以你需要检查这个

in case the title is just command prompt - it could be different so you need to check this.

默认的标题:

在这里输入的形象描述

这篇关于通过.BAT插入命令,在已经打开CMD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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