如何我作出这样一个文本框目标程序和类型的一个.BAT [英] How to i make a .bat that targets a program and types in a text box
问题描述
我不知道从哪里开始就这一个。我所看到的都是这样的答案,但我不知道如何将它们格式化,因为我想要的东西。我只需要为目标,而其开的Minecraft服务器,并通过在控制台输入停止将其关闭。我没有code,以示对但这将是一个其他的文件,所以我可以启动它,然后把它关闭程序。顺便说一句,我不认为我可以使用 TASKKILL
但是,任何事情都会有所帮助;!)三江源非常
I have no idea where to start on this one. I have seen answers that are like this but I don't know how to format them for what I want. I just need to target the minecraft server while its open and close it by typing "stop" in the console. I have no code to show for but this will be in a other file so I can launch it and then have it close the program. btw I don't think I can use taskkill
But anything will help ;) thankyou very much!
推荐答案
这单独使用批处理文件是不可能的。有在系统中获得输入到另一个程序两种主要方式(在这种情况下,将java.exe):
This is not possible using a batch file alone. There are two main ways to get input to another program in the system (in this case, java.exe):
- 让你的程序监听一个特殊的信号。有对的Minecraft几个管理插件,这将在Java进程中运行,并会做你的需要。
- 欺骗性用户输入到该程序。在一个控制台应用程序的情况下,你可能会使用的SendKeys()的解决方案。见<一href=\"https://stackoverflow.com/questions/451228/how-to-send-input-to-the-console-as-if-the-user-is-typing\">How发送输入到控制台好像用户是一些例子打字。
- Get your program to listen for a special signal. There are several administrative plugins for Minecraft which will run in the Java process and will do what you need.
- Spoof user input to the program. In the case of a console app, you would probably use a SendKeys() based solution. See How to send input to the console as if the user is typing for some examples.
在我的世界的情况下,我认为第一个解决方案将是显著更容易,因为插件社区已经提供了一些解决方案,这个确切的问题。 @Frxstrem推荐<一个href=\"https://bukkit.org/threads/admin-rcon-mcrcon-remote-connection-client-for-minecraft-servers.70910/\"相对=nofollow> mcrcon ,我想是一个很好的解决方案为已任。
In the case of Minecraft, I think the first solution is going to be significantly easier, because the modding community has already supplied a number of solutions to this exact problem. @Frxstrem recommended mcrcon, which I suppose is as good a solution as any.
这篇关于如何我作出这样一个文本框目标程序和类型的一个.BAT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!