The command to handle that is "net use..." with different options. A description of the command can be found on Microsoft website: Net use .
The two batch files can do the job:
- User1.bat has the following lines:
net use * /delete /yes
net use x: \\NetServerName\SharedFolder *
/user:NetServerName\User1 - User2.bat :
net use * /delete /yes
net use y: \\NetServerName\SharedFolder *
/user:NetServerName\User2
net use * /delete /yes
" in the both files deletes all existing connections. The key "/yes" is not documented in the official Microsoft description, but it works as a default response to the command prompt question [Y/N].The second command sets up new mapping to the specified shared folder from the specified user. An asterisk (*) at the password key position makes the command ask for the password.
I put shortcuts to the batch files on the desktop and switching between these shared folders became trivial.
0 comments:
Post a Comment