I guess I was vague in my question. I'm looking for a way to do just what you describe, but from the command line. Something like:
NET USE D: \\SERVER\SHARE /NOCHANGE
Where the /NOCHANGE switch is my idea of what makes the drive unchangable for that session. It seems like I've seen a switch for NET USE that does this, but I can't remember what it was or where I saw it mentioned.