SERVER SIDE
On Server machine run commands in CMD or Powershell as admin

net config server /autodisconnect:-1

netsh int tcp set global autotuninglevel=disabled                                                                                                                                                               

  1. Locate and then click the following key in the registry:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters
  2. In the right pane, click the autodisconnect value, and then on the Edit menu, click Modify.
  3. On the Edit menu, click Modify.
  4. Click Hexadecimal.
  5. In the Value data box, type ffffffff, and then click OK.
  • If the autodisconnect value does not exist, follow these steps:
    1. On the Edit menu, point to New, and then click REG_DWORD.
    2. Type autodisconnect, and then press ENTER.
    3. In the Value data box, type ffffffff, and then click OK.
CLIENT SIDE
On Client machine run commands in CMD or Powershell as admin

net config server /autodisconnect:-1                                                                                                                     netsh int tcp set global autotuninglevel=disabled

Locate and then click the following key in the registry:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanworkstation\parameters

Create the a hexadecimal key and name it “KeepConn

set the value to 0000ffff

NOTES

Windows will drop idle connections after a specified time-out period, I think it is 15 minutes by default, to prevent wasting resources.

this disables it.