Fix bat files. Improve generator.