Unity Game Crashes on Windows Startup

Hello there, I’m having an issue with Windows Server 2012, i think its in general in Windows.

I’m trying to run a game when the computer boots “System-Startup” using (GPEDIT.MSC). The game runs fine when its automatically launched when a user logs in, but I need it to run at START-UP, since I’m using AWS EC2 to run some windows Servers.

These servers contain a custom application that works fine when launched at startup. However when i try to run a Unity game, the game gets to the Processes Log in Windows Task Manager but its frozen. They both run under SYSTEM (user) since the EC2 instances don’t have a Logged-In User.

I’ve been trying several ways to achieve this with no luck at all. from launching it from a BAT, another program that’s running already as system also, under with special permissions (“runas”) nothing so far, The game launches but gets frozen, as simple as it is. (I test everything with a DataBase running online, which applications get to run and which don’t)

Last thing that comes into my mind to try its Powershell…

If anyone has a way please please let us know, I would really and gratefully appreciate this.

What does player log say?

Solved:

You need Unity Pro to be able to run your game “build.exe” with arguments “-batchmode -nographics”.
This arguments tell the unity build that this build does not need any human interaction and allows it to run under System, instead of requiring to run under a User.