How to automate script using c#

check the follow starting-points:

Rhino inside

legacy COM Interface

not recommended
see this topic

rhino only

on the windows side, you can stay in one rhino instance and open / close documents via rhinocommon.
so you will have one command in your plug-in
“start my batch process”

events

also check the power of RhinoDoc Events
and RhinoApp Events

kind regards - tom