Command line for a batch file would be something like this:
net use q: \\servername\share /user:yourname *
where q: is the drive, servername is the server, share is the share name, yourname is the username, and * prompts for a password. If you don't want to prompt for a password the just type it in after the username like:
net use q: \\servername\share /user:yourname passwordhere -----------------------------------------------------
"It's true, its damn true!"
-----------------------------------------------------