You are close.
Let's say you want to map drive L: to the SHARED folder on \\MACHINE1 but you want all users to connect to this share using the user account of BOB in the MYDOMAIN domain, instead of their own accounts. Well, you can't have everyone logging in as BOB; that would just make a mess of things!
So, your login script to do the above would look like this:
NET USE L: \\MACHINE1\SHARED /U:MYDOMAIN\BOB "password" /PERSISTENT:NO
You would put BOBs password without the quoatation marks.
So, that would do it.
Now, if you don't want to connect to the shared folder as BOB, you could leave out everthing from the /U switch to just have the currently logging in account use their own credentials to connect to the share:
NET USE L: \\MACHINE1\SHARED /PERSISTENT:NO
hope this helps