Windows – map network driver from CMD

Sometimes you need map network drivers in command line(cmd) for example if you are preparing some .bat files etc.

At Windows, it is quite simple all you need is net use command.

net use DRIVE: PATH
#so for example
net use R: \\synology\review

#if you need add authentification
net use DRIVE: PATH /user:user password
#so for example
net use R: \\synology\review /user:synologyuser ultrasecurepassword:)

#if you need make this persistent jsut add /persistent:yes so drive will be mapped after restart
#so for example
net use R: \\synology\review /user:synologyuser ultrasecurepassword /persistent:yes

#of course you can also delete mapped drives
#for example remove all maped drives
net use * /delete

Quite simple right? No big deal. One note to end. All user got their own mapped drives. So if you open command lines like administrator and map drives, the standard user will not see them. So always map network under user what will be using them.