In my opinion, AutoHotKey feels like overkill for this, especially if you haven't already installed it for anything else. I'm also not sure it's worth asking AI to build it for you. 8-? You can probably just put a two-line batch file in your mame directory:
c:\NAME\mame.exe <options>
shutdown /f /s /t:60Shutdown ships with Windows, so you won't need to install anything (except MAME). The options in this case mean "
/force applications to quit while
/shutting down the PC, after a 60-second
/timeout". The timeout defaults to thirty seconds, and you can use "
/t 0" to shutdown immediately.
If you just want the menu to pop up when MAME starts, leave "
<options>" off. There are a gazillion options to mame, most of which you probably don't need until you get the basics working. See
https://docs.mamedev.org/commandline/. If you want to automatically run a game instead of seeing the menu first, you can use the driver name instead of (or in addition to)
<options>. For example:
c:\MAME\mame.exe tempest -skip_gameinfoAlthough, if you start it this way, I think exiting the game with <ESC> also exits mame, so it'll just fall through to the shutdown -- you'll never be able to start any other game. If you want to auto-start a particular game and return to the menu when it exits, I think you'll need to close the game through the <TAB> menu.
Anyway, once you've saved this in a file, called (for instance)
letsplay.bat, you can set up a scheduled task to start it whenever you logon. Use Task Scheduler from the control panel (taskschd.msc) or schtasks.exe from the command line.
schtasks /create /tn "Start MAME" /tr c:\MAME\letsplay.bat /sc onlogonThe GUI's probably going to be easier to understand, though. You only need to add this scheduled task once, of course, not every time you run mame or anything.
Good luck!