Solving the problem of automatic disconnection of mapped network drives
The mapped network drive is automatically disconnected for a period of time due to the default time-out period for the Server service's automatic disconnect feature, and we can change the disconnect time in the following ways.
First, use Registry Editor to increase the default time-out period.
1. Locate and click the following registry key in the registry:
Hkey_local_machine\system\currentcontrolset\services\lanmanserver\parameters
2, in the right pane, click Value Autodisconnect, and then on the Edit menu, click Modify. If the value autodisconnect does not exist, follow these steps: A. On the Edit menu, point to New, and then click REG_DWORD.
B. Type autodisconnect, and then press ENTER.
3, click "Hex". Type ffffffff in the Value data box, and then click OK.
Second, change the default time-out period
1, open the Command window, type the net Config server/autodisconnect:number command line, and then press ENTER
(where number is how many minutes you want the server to wait before disconnecting the mapped network drive.) The maximum value for this command is 65535. )
2. Setting the automatic disconnect value to 0 does not mean that the automatic disconnect feature is turned off, but rather that the server service disconnects the mapped network drive only after a few seconds of inactivity.
3, to turn off the automatic disconnect function, open the Command window, type the net Config server/autodisconnect:-1 command, and then press ENTER.
To map or disconnect a drive using the Net use command
The net use command can be useful for batch files and scripts. To map or disconnect a drive using the net USE command, follow these steps:
"To map a network drive, use the net usage x:\\ computer name \ Share Name command, where x: is the drive letter to be assigned to the shared resource."
To disconnect a mapped drive, use the net Usage x:/delete command, where x: is the drive letter of the shared resource.
Disconnect Drive First: NET use */d/y
Map net use with another user h: \\192.168.12.202\backup SZTC1234/USER:DUAN_KC
Reference Note: https://support.microsoft.com/en-us/kb/297684#bookmark-letmefixitmyselfalways