Map a Network Drive from the Windows Command Line
Category : How-to
The windows command line can be very useful to quickly perform repetitive tasks.
It is easy to write batch scripts which combine actions and can be easily triggered from the command line.
Mapping a network drive in Windows in a common task and can be done from the command line. The syntax is:
net use [drive letter]: /persistent:[yes|no] "\\path\to\share"
The persistent command will make the mapped drive persist over reboots.
The below example maps drive Z to a server called fileserver.jamescoyle.net and the share homes.
net use z: /persistent:yes "\\fileserver.jamescoyle.net\homes"