Script for MD

Hi,

I want to write a script on DS2017 which can automatically do the following:

1)Apply forcefield 
2)minimizes the molecule (with min.xml)
3)Runs Heating (with heating.xml)
4)Equilibrates (with eq.xml)
5)Runs dynamics with NAMD (prod.xml)

Extras: how would i make it automatically move to the next molecule in folder? a script for MMPBSA?
Any suggestions ?