Since it's your game, meaning you own the code, then that means that you need to rewrite it as a Windows Service. Servers are made to run services. Windows Services are designed to run without user interaction, regardless of whether anyone is logged on or not, and can be started automatically when the machine boots. (Just set your service to Automatic and it starts right after the OS loads.) In addition, you can define advanced recovery options in the service controller, to have Windows automatically restart the service for you if it crashes, or even send you an email notifying you that your service has crashed if you were so inclined.

You do not interact directly with a Windows Service. Windows Services have no user interface and they don't create a window on a desktop. (They shouldn't.) You will not see a console window for it when you log on. However, you can write a separate application that can interface with your service, to allow a user to configure settings or perform administrative functions on your service. Your administrative application might be used to set and read registry entries or configuration file settings that your service uses, etc.
Basically, anything else that you do besides what I just described above is doing it wrong(TM), IMHO.
But for the sake of completeness, let's explore some of the ways in which you can do it wrong, but could still technically accomplish what you want.
Say there is a problem and the server is restarted unexpectedly, I should not have to login for it to start. Is there some way to do this?
Sure. Make the executable run at startup by putting it in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
. (Sorry that is for user login.) Or put it in a Scheduled Task that is configured to run at system startup. (Of course if you go the Windows Service route it's simply a matter of setting your service to Automatic in the Service Controller.)
say the application crashes, is there a way to make the OS close the crashed executable and restart it?
This does not make sense. If the process is still running, then it did not crash. If it hung because of something that you did wrong in your code, e.g., lack of exception handling, that is just something you need to fix in your code.
On the other hand, if you wanted to run a script every 5 minutes (through Task Scheduler) that checked if FunGame.exe
was running or not, and start it if it wasn't running, then you're free to do so... though I would hate you if you ran something like that on one of my servers.
In addition, when I do login as administrator, if I could see it running, that would be awesome too. (wg: visible console window)
Not going to happen - unless you take my advice about making a separate application that was specifically designed to be an admin/monitoring interface into your service, then you could stick that application in the Administrator's startup folder, etc.
Oh and one last thing... there is also srvany.exe
... it's old and unsupported, but you may want to look into it as a generic service host if you're not going to make your own service.