What Javascript ?!?
Java and Javascript are completly different things...and when playing HnH there's no Javascript involved ...
When you run the run.bat it starts the command interpreter (CMD.exe) which executes the commands (written in bat file) in case of Ender it starts Java (from given path with certain memory settings) which loads haven.jar and connects to HnH server ... and that's the way it's supposed to be used...
I really don't get what you're trying to express when writing
to run the javascript to try to log in
- run what and how?! Descibe please...
If you're opening CMD.exe manually and just type in the content of the run.bat you'd have to cd (change directory) to Ender folder or put the path in as it doesn't know where to find haven.jar (that's why run.bat is in Ender folder)