Ok, you need a daemon (that's "server" for you windows folks) listening on a TCP port, for commands to execute. Upon receiving them, it executes them.
Or, you can specialize the program, to wait on a TCP port for a textfile, keep reading until reaching a special character, save that into a .bat file, then execute....
But of course, security issues
