Rework the Windows batch file.

Treat environment variables correctly with respect to quoting.
Show errors if various paths cannot be found.
Exit with 1 on failure.