Maya batch automation (not render)

Is it possible to open instance of maya, which automatically runs script on startup and closes when it finishes?

It could be useful to run tasks in background like exporting caches and making playblasts without disturbing work process of a person behind that computer.

I’ve been looking into mayabatch and render commands, but I think it’s a dead end.

Have you looked the maya.standalone module and mayapy.exe that ship with Maya? Maybe worth a google.

Thank you this is what I needed, it’s perfect for creating cache files and other stuff. Just playblasting is not available because there is no UI and playblast works by capturing current openGL rendered screenspace. No issue, I can make it render scene similar to playblast.