Fixed script and add batch file for automating scripts.