The default timeout is 15 minutes. From a command prompt on the server side
net config server /autodisconnect:-1
for no disconnect.
Setting this from the command line may turn off auto tuning for the server
service. So a better solution is to navigate to
HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters
and set the Reg_DWord hex value of
"autodisconnect"=ffffffff
If "autodisconnect" doesn't exist, Add it.
(note; ffffffff = aprox. 8171 years)