Generate env and bat files.

...Thanks to Brian Davis for the contribution.