Check this link
http://www.erlandsendata.no/english/...filesscripting