I'm making some utils that uses NetUseAdd and NetUseDel functions to connect/disconnect to share. In Windows 7 I noticed that between calling NetUseDel and real disconnnection passes nearly 12 seconds. I made some investigations and found that net use \server /del also disonnects only after 12 seconds. Here's little script and Wireshark output, corresponding to run of script:
net use \\server "" /user:""
net use \\server /delete
https://i.stack.imgur.com/5CyCw.png
Setting last tree connect smb command as reference, we can see, that tree disconnect delayed for 12 seconds.
Does anyone know how to cut such a timeout?