On login, how do I get Windows to mount/connect a mapped network drive automatically?

18

2

How do you automount an SMB share in Windows 7? When I first login, the drive appears but is not "mounted". It is a mapped network drive, but iTunes will not find the music located on the server until I click the drive in Windows Explorer and mount the drive. It says in Windows Explorer that the drive is "disconnected".

agz

Posted 2013-02-26T05:48:38.250

Reputation: 6 820

Does it work better with the firewall disabled ? – harrymc – 2013-03-15T08:45:42.030

Is this not more of an iTunes issue than a Windows issue? – Alan B – 2013-03-21T08:58:37.837

1When you write a question, if you distill the sum total of the query into a well-phrased question (in the title), you're far more likely to get a good result than with a vague non-question title that doesn't engage the thought-process of the reader. – killermist – 2013-03-21T20:01:02.900

Answers

21

You could try adding on logon via the 'net' command

For example,

net use z: \\server\share

You could get this to start at logon a number of ways - put it in a batch file and add to startup items, add it to task scheduler, or add it to the local group policy are three that come to mind (no doubt there are others)

askvictor

Posted 2013-02-26T05:48:38.250

Reputation: 1 450

1No @agz. 5 years later it still doesn't – Guian – 2018-03-14T13:45:09.687

3I have been using something like this for years, but it would be nice to hear from some windows gurus. I find it hard to believe that there is no "built-in" way to auto-mount network shares. – Ярослав Рахматуллин – 2013-03-15T02:25:38.713

A persistent mapped drive is the built in way to do it, but if there is no network connection at the instant it tries to mount it, it will be left in a disconnected state. This is usually the case with wireless networks, which are usually connected at a later stage of the login process. – askvictor – 2013-03-15T06:43:19.703

@askvictor so if i have ethernet, will it automount? – agz – 2013-03-19T00:59:59.330

7

I generally simply use a batch script which does a "dir" command on that share.

Open Notepad, and enter the following:

dir I:

Replace I with the drive letter you have mapped.

You can also do >nul on the end of that command to hide the output in the command prompt window when it runs.

Click File, then Save As.
Change Save as Type to All Files. Save the file in the C:\Users\username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup folder and call it mapdrive.bat. Replace username with your own username.

Next time you start your computer it will run this script. It will force windows to connect to the mapped drive.

Dave Lucre

Posted 2013-02-26T05:48:38.250

Reputation: 1 167

3

A simple net use command is all that should be needed. If your network share requires a different username/password, those can be specified too.

net use i: \\server1\Directory3 /persistent:yes

Net Use docs:
http://technet.microsoft.com/en-us/library/bb490717.aspx

I map shares like this all the time without issue. Sometimes it takes a moment or two after logging in for the share to reconnect. It's not always instant.

Lee Harrison

Posted 2013-02-26T05:48:38.250

Reputation: 2 046

1

you can try using a batch file to copy a non-existent file from the mapped drive to the local c:\ drive. This would force the mapped drive to mount and look for the file, return an error, but the drive will be mounted.

A simple batch file in the startup group should do the trick -

copy :\badfile.txt c:\

Save as MOUNTME.BAT then put this in the startup folder.

Chris E. Avis

Posted 2013-02-26T05:48:38.250

Reputation: 1 637

Haha! My startup folder is on the network drive! – chuckkahn – 2015-08-15T15:25:20.963

0

When you map the drive (In explorer) choose to map an internet (connect to a website to share your documents) and then map as usual. This is how we map our SAMBA shares and it maps on login. I have never delved into the differences between this method and the normal map method or between in and the normal net use x: \server\path method Our samba shares are off site and on network, and it works great...

The only other odd thing we have to do is enable NTLM v1 if v2 does not respond.

Austin T French

Posted 2013-02-26T05:48:38.250

Reputation: 9 766

-3

Assuming you are using windows 7.

Click on "Computer", you will see "Map network drive" button on top. Click "Map network drive"

Select drive letter, enter your network folder path.

That's it.

Danny Hong

Posted 2013-02-26T05:48:38.250

Reputation: 95

The OP has asked for mounting the drive automatically on logon, not by doing it manually as you have mentioned! – Syed Waqas – 2018-03-25T07:33:57.757

Yes, there is a check box "Reconnect at logon", just check on it. – Danny Hong – 2019-11-21T09:11:53.890