Both of those two items are not valid in my case. I have been running my arcade with windows 10 1606 enterprise an hd5450. Boots straight to attract with nothing else (no explorer). However, I have never run such an old mame version.
I assumed that most users are not suffering from this, or else we'd be reading about it, alot.
Are you running a fresh install of windows?
I installed the OS about 4-5 years ago. Although I have never experienced such behavior with any other app. None.
What apps do you have open? Is explorer running?
Different apps at different times (includes explorer). Sometimes nothing.
Explorer, Notepad, Notepad++, Opera, qBittorrent...
Doesn't matter in which combo. The one and only pattern I can see is that at least one app (window) must be "always on top" for AM to successfully launch emulator. I just tried again without any app "always on top", and mame was not launched (through AM that is, launching mame independently is always successful). This time I tried yet another app, VLC, and set it's window "always on top", and as expected, mame was launched successfully. I will later disable the TortoiseHg Overlay Icon Server to see if that has any effect. Btw, by "explorer", do you mean as file manager, or as desktop shell ? I have not tried terminating explorer as desktop shell yet, but I'd rather lanuch an app "always on top" rather then kill explorer for AM to work. Not that I woulnd't love to get rid of the former annoyance (random app "always on top") though.
Can you post your emulator config file?
You mean AM's MAME.cfg, or MAME's mame.ini ?
What terminal command are you using to launch separately of attract?
Anything that's valid, like: c:\path\to\mame.exe 1942 -rompath e:\path\to\mameroms.
But also I take, for validation, the expanded (by AM) commandline, like..
[name] -rompath [rompath] -d3d -d3dfilter 1 -d3deffect scan75 -d3dscan 75 -skip_disclaimer -skip_gameinfo
..which is expanded to..
C:\__etr7priv\Applications\mame078b\mame.exe 1942 -rompath C:\__etr7priv\Emulation\MAME/ROMs\0.78/ -d3d -d3dfilter 1 -d3deffect scan75 -d3dscan 75 -skip_disclaimer -skip_gameinfo
..and I copy that expansion to command processor console and execute, and it runs without any problem.
-edit-
I closed the TortoiseHg Overlay Icon Server without postive outcome.
If I had modded this windows installation I would suspect that could possibly be the problem, but I have not touched it, unlike my old XP which I modded with various desktop shells, custom icons (tango) reinforced by an on-boot always executing program, hacked uxtheme.dll, etc. But again, I have not touched this Win7 installation.