Here is a few smart uses of the good old net use command.
If you need to do a authentication for a share in a script between two machines not in the same domain it can be done with the following command. Note that it does not state a letter for the network drive. It just authenticates itself.
net use \\servername\share /USER:username passwd
If you need to delete the authenticated session (you can only have one session at one point in time between to computers), you can delete it using this command:
net use \\servername\share /del