Saturday, 29 January 2011

Mapped network drives not reconnecting on Windows 7

I have recently been using Windows 7, and have found an irritation with the way it handles network drives. I have all my music and media on a NSLU2-driven network drive, which under XP was configured to reconnect at startup. Which it did.

With Windows 7, it appears as though it tries to reconnect network drives before the network connection is available, leading to a perpetual start-up error of "network drives failed to reconnect". You then have to manually go to explorer and double click the drive to bring it up. This is irritating.

My workaround is to use a batch script at startup that pauses for a 15 seconds, letting the network connection come up, and then map the drive.

I created a script called "map drive.bat" and put this in the start-menu Startup folder. The contents are as follows:
@echo off
echo waiting for network...
timeout /t 15
net use z: "\\Nslu2\disk 2" /persistent:no
This maps my nslu2 share to the Z:\ drive, non-persistently, so it will disappear on reboot (but this script is run at startup so that's fine).

The downside is that you have to run the script manually if the share comes up after you boot windows, but that's no worse than having to open explorer to load the drive if you do drive mapping the normal way.

No comments:

Post a Comment