To automate use the command line options if i am understanding your problem correctly.