3

After looking for a couple of hours, I decided it's time to ask for some help. I have a local server of an online game, which has its own command line where the admin can execute different commands, like /kickuid x (which kicks the user with the useruid = x) and many other commands. Here's a screenshot of how it looks like:

enter image description here

I am interested in automatically executed commands, but the problem is that I have no idea of how I could pass a command to the game service through cmd.

I would be very grateful if somebody knows how to(assuming that it's possible) send commands to a running process through cmd or maybe in another way.

Grant Winney
  • 65,241
  • 13
  • 115
  • 165
Chris
  • 31
  • 2
  • 1
    Is it your own code or you are try automate someone else program running on your server? Does it already have remote admin capabilities? – Alexei Levenkov Aug 11 '13 at 16:24
  • This is the server management console for the game process(there's more processes, like the login server and a database agent). All I want is to know if and how it is possible to automatically pass commands to this console, without any human interaction. – Chris Aug 11 '13 at 21:39
  • Check tools like [Autoit](http://en.wikipedia.org/wiki/AutoIt) for sending keystrokes... – Alexei Levenkov Aug 12 '13 at 03:09
  • Unfortunately I want a more professional approach, sending keystrokes isn't an option. I hope to somehow be able to send commands from outside the program. – Chris Aug 12 '13 at 09:37
  • I've added "no" as an answer, you may get better answer if you actually specify exact program you are trying to control. – Alexei Levenkov Aug 12 '13 at 16:44

1 Answers1

1

No, there is no generic mechanism to "send commands from outside the program".

Possible approaches to look at:

  • sending keystrokes is one ultimate fallback to automating programs with any UI
  • some programs expose COM automation interfaces (like Office/IE), or even COM remoting.
  • some program expose REST remote management API (usually if the rest of program uses some form of HTTP server)
  • some read configuration/other files
  • some have custom API to execute commands remotely (i.e. most DB servers)
Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179
  • I'm afraid I don't see another solution either, thank you Alexei for taking your time to reply. – Chris Aug 13 '13 at 12:36