When I open Computer, I can see my network drives, but they are shown with a red cross indicating that there is indeed a problem with the connection to them. Applications which rely on data from these network drives cannot obtain their data, and fail in their own ways. The particularly annoying aspect of this is that there absolutely no problem with the network connection to these drives. Simply double clicking on the drives will open them up and restore the connection. All applications will function correctly thereafter... until the next time I boot up the machine.
Below is a workaround you can use to ensure your remote drives are available for use when you turn on your PC. For my environment, I'm running Windows 7 64-bit and have a Synology DS411J which is a NAS drive. But really, this should work for connecting any remote network drive.
The trick to getting around this is to tell Windows to map your network drive every time your computer boots up. It turns out this is quite easy to do. All you have to do is write a script which, when executed, will reconnect your network drive and then set up a task to run the script when the computer starts up. Mapping a drive simply means that in Computer, a drive, with a drive letter - say Z: - so that whenever you refer to a location on the Z:, Windows will actually look at the network location mapped to that letter.
Creating the Script
You want to create a Windows Batch File (which has a .bat filetype) which will serve as your script. You need to know at this point which drive letter you will be using for this network drive. I use z: in the following example. You will also need to know the location on the network that you are wanting to map a drive to. In the following example, I am accessing \\DISKSTATION\Media folder which is on my NAS drive.
In the following example, I first remove the drive and then add a new one in. I do this just in case any other folder has stolen the Z: somehow. I always want to be able to depend on the Z: having my media so I find it better to remove first, then re-add.
- Create a new file which has a .bat file extension
- Give it a name (MapDrives.bat for example) and put it somewhere you'll remember.
- Open this file in Notepad.
- Add the following lines:
- net use z: /Delete
- net use z: \\DISKSTATION\Media
- Save and close the file.
- Double click the file and make sure your drive appears in Computer as you'd expect. If you can't see the new drive:
- Check you can actually reach the network location.
- Edit the script, and add the word pause on a new line, after your other two lines. Run the script again and it should tell you if there was an error.
Your script should resemble the following:
Running the Script
Now that you have a working script, you need a way to get this script to run automatically. You could put it in your startup folder, but I prefer to use the built-in Task Scheduler.
- Open Task Scheduler
- If you can't find it, enter %windir%\system32\taskschd.msc /s into your Run command.
That is you all set up to go. Restart your computer and make sure your drives are still available to you.
Note, you might still see the balloon popping up telling you there was a problem connecting to your drives, as that 30 second delay might not have happened by that point. You can disable this balloon notification if you so choose. When you see it, click on the spanner icon, and select Hide icon and notifications.
Any problems? Not working for you? Steps missing? Let me know in the comments below!