Thursday, March 5, 2009

Batch file to map network drives

Batch file to map network drives

Net use is the command use to map network drives, printers etc.

Below are some common examples of net use command. Stick the command in a .bat file and use it at startup etc.

simple mapping to share in a server
net use i: \\servername\sharename

map a drive to a share with a username and password
net use p: \\servername or ip\sharename password /USER:domain\username

to disconnect a drive
net use i: \\servername\sharename /delete

If the servername or a shared drive has a space within itself use the quotation marks
net use i: "\\server 1"\sharename

No comments: