To anyone who is having a problem running build.bat on Windows:
Build.bat is used to build the JBoss Portal. On Windows, build.bat may not work if you have spaces in the directory names of the path containing your portal project. For example, my project was located under "Documents and Settings". The symptom is that build.bat exits with this strange message: "and was unexpected at this time."
To fix it, just move your project to a path with no spaces in the directory names.
Yes, as a rule I never do "anything java" in Windows under a directory with spaces. I should add that note to the docs anyway.