I don't think there is a way to connect to a WiFi network and enter the credentials using a batch script.
Are you able to install other programs?
If so, have a look at
http://passwordsafe.sourceforge.net/. It's a pretty nice little application that stores your passwords securely in an encrypted datafile.
Alternatively, you might have better luck with a Powershell script. I'll look into it and let you know what I find.
EDIT: After a breif search I couldn't find anything that looks easy to implement (ie scripting), although someone else might know of a way.