Often, if you have a windows 7 computer on your network that has a few network mapped drives, you may have noticed that in some cases these network mapped drives may disconnect from the network itself after certain period of time of inactivity, and that a red “X” shows up on the icon of the mapped drives like below.
These are actually misleading because if you try to access it again it reconnects automatically and the red X disappears right after. The reason why this happens is because Windows 7 system can drop the idle conections after a specified timeout period, 15 minutes by default. Usually, it’s fine unless you have applications run based on the live mapped connection. Or it will fail because they don’t find any live connection required.
If that’s the case, this Microsoft KB 297684 reveals a quick fix that can fix this on either server side or the client side.
On the Client Side
Fixing this issue on the client side involves the registry change. Simply open regedit and locate KeepConn key in the registry:
If not exist, create it in Reg_Dword, and set the time in seconds. For example, I set it as one day to keep the connection live.
On the Sever Side
If you are network admin who has the rights to change the server settings, you can turns off the autodisconnect feature of the server service on the server side so that all workstations that have the network map drive to the server can keep the connection live as long as they want to. To do so, simply run the following command from a DOS Prompt window that runs as administrator.
net config server /autodisconnect:-1
However, for whatever the reason, if you still want autodisconnect feature on but want a longer period to disconnect, you can use the same command as following:
net config server /autodisconnect:number
number is the number of minutes that you want the server to wait before disconnecting the connection.
That’s it, and hope it helps.
/update on May 20, 2014/
Reader HiramAbiff shared another solution that involves a re-written VBScript, instead of batch file, that seems to be an alternative solution that will solve this issue, if the solution mentioned above didn’t work out.