ENVI comes with an IDL-based API that allows you to automate ENVI from IDL. I have listed a few resources below that I think could be helpful to you:
http://www.exelisvis.com/envi-API/
http://www.exelisvis.com/.../ArticleId/5248.aspx
http://idldatapoint.com/2...nvi-5-batch-program/