How to enter text into CMD windows? [duplicate]

You’re going to have to start the Minecraft service process from your .NET application. Whatever you’ve got now in the batch file you’re using, you can duplicate that in the Process start code in C#, or you can just have your C# code run the batch file.

If you want a config file providing startup parameters, you could put that stuff in app.config and have your application give them to the Minecraft server process on startup.

Once you’ve got the process started, your application can keep the Process object and send repeated commands to its standard input stream, as outlined in this answer.

Leave a Comment