How do I stop mapped network drives which aren't available preventing Windows 7 64-bit booting past KSOD?
I have a QNAP server on my home network which I've mapped a few folders in Windows-7x64 using NFS. This works perfectly except for when I switch the server off (or disconnect it from the network). When the server is not available, Windows boots fine up until just after you've typed in the password and pressed enter, at which points it sits on KSOD doing apparently nothing.
Based on this question I loaded up in safe mode, 'disconnected' the mapped drives and now I'm back in normal mode, exactly as before.
What I want to know is how I can keep drives mapped when the server isn't available and still have Windows boot up? Or failing that, where's the best place to dig to find out?
Solution 1:
It will probably finish booting to the desktop, it will just take a while, as you are waiting for each mapped drive's time-out period to lapse before Explorer will finish loading.
This Ask Leo blog entry has lots of good info on it: Why does Windows Explorer take so long to display sometimes?
You may want to write a batch file that will map the drives you want, but ensure they are not set to map 'persistently', so they get killed on log off. Then at next boot Explorer should load quickly (no maps), and if you want the drives you can just run the batch file to map them (setup a desktop shortcut to the batch).
Perhaps use Windows' Task Scheduler to have the mapping batch run every time, but delayed until 30 seconds to a minute after log on, that way it won't slow down Explorer's loading time.
You could also probably set up a task to run a batch containing net * /del
or a like to ensure all mappings get killed at log off, including ones created as persistent.
Edit/More info after comment question:
"Is that timeout duration value easily editable or buried?"
There doesn't seem to be a place you can actually define it. Check out http://support.microsoft.com/kb/977346 for a possible workaround (I don't think it'll help your case, but hey can't hurt to try).
More info on batching it:
If you end up creating a batch file to map the drives, and don't want to delay it via the Task Scheduler, you can use Ping to test the connection before attempting to map it. Ping can be set to use a specific timeout, so you can set it low, and if it fails to ping, don't map.
Something as such in a batch file:
ping 10.3.3.3 -n 1 -w 500 | find "Reply"
if errorlevel 1 echo Machine Not Found && goto :eof
net use Q: \\10.3.3.3\Share
This will ping 10.3.3.3 once (-n), with a time-out (-w) set to 500 milliseconds. It will then try to find "Reply" in the results. If it doesn't find that (no reply because machine doesn't exist) then it echoes that it wasn't found and jumps to the end of the file. Otherwise, if it finds "Reply" it will attempt to map Q: to the share "Share" on 10.3.3.3.
Solution 2:
For me, this worked:
;### kill the long "restoring network connections" at logon (defer=ghosted connections)
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider]
"RestoreConnection"=dword:00000001 ;(0=no attempt, you must click it)
"RestoreTimeout"=dword:00000005
;### Ghost the connection if not responding within RestoreTimeout
"DeferConnection"=dword:00000001
;### network drive map timeout in Explorer if connection is lost (def is 60 sec)
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters]
"ReconnectTimeout"=dword:00000005
Except I set RestoreConnection
to 0, since I do not need the drives ready all the time. Then the black screen timeout is gone.
Source: http://www.sevenforums.com/network-sharing/274680-timeout-mapping-network-drives-windows-login.html