I’m building a machine that only plays a game. You power it on, the game starts automatically in full screen. When you quit the game, the pc turns off.
The start up part is easy but shutting down windows when a game stops seems a bit more tricky. Does anyone have any idea how to do this?
thats the script you would make in a batch file. Windows 7-10
One issue you will run into is that you cant bypass ALT+TAB or WINDOWS+TAB due to it being built in the registry. That will be the downfall.
Example: i boot up the game, alt+tab to windows desktop, disable windows scripting service, close the game. This would allow me to do anything as a normal computer. Rebooting will not resolve, since, i stopped the scripting service itself. There are several ways around all this, via Mr Google, but, keep in mind, there is always a way back to desktop (unless you dev some kiosk software to block).
i don’t totally understand what you mean by downfall…it would be good to have the ability to ALT+TAB back to windows in case I need to fix anything or if one day I want to put the computer back to a normal computer.Or do you mean I couldn’t ALT+TAB?
thanks for the help!
it’s just for someone’s personal use in their home, not in a public place. so being able to alt+tab out would be good in case they ever want to change how the computer is used.
I found this and it seems to work ok so far:
for the boot part, dropping a shortcut in the startup folder works, or register the exe to run at logon. for the shutdown part, run shutdown.exe /s /t 0 after the game process exits, a tiny batch wrapper around the exe does it.
the part that bites later is visitors escaping while it runs, alt+tab to the desktop and killing the script. Kiosk Lockdown Toolkit is a kiosk mode plugin for Unreal Engine 5 for exactly this kind of single game machine, it adds the run at windows startup node, keyboard lockdown, and a watchdog that restarts the game after a crash or kill: Kiosk Lockdown Toolkit — Block Alt+Tab, Win Key & Taskbar for Kiosks | Fab
fair warning, ctrl+alt+del cant be blocked by any app, thats a windows level thing, so use a group policy for that last gap.