Map Command Pattern:
[command] [drive letter] [\\HostName\sharename] /user:"[DomainName\username]" [password]
Save the following code into mount_drives.bat file using notepad. For example:
net use Z: \\server01\share /user:"server01\Jonathan" MySecretCode
Full documentation on the net use command can be found on Microsoft’s Docs page here.
To auto mount on login, place the batch file into the following location:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
You may easily navigate to that path by pressing the Start menu, then typing run and then pressing enter.
![](https://askwinters.com/wp-content/uploads/2020/08/Screen-Shot-2020-08-21-at-6.58.58-PM.png)
The run dialogue will open. Type the command shell:common startup and press enter.
![](https://askwinters.com/wp-content/uploads/2020/08/Screen-Shot-2020-08-21-at-6.59.13-PM.png)
Place the mount_drives.bat file into the folder.