I agree with dalchina.
Perhaps merely disabling then re-enabling the WiFi adapter would achieve what you want.
Try it manually the next time WiFi is dropped.Control panel,
[View by - Small icons, just so you can see everything],
Network & sharing centre,
Change adapter settings,
Right-click on the WiFi adapter & select Disable,
Right-click on the WiFi adapter & select Enable
If that does whatever it is that you want done then you do not need to take the drastic step of restarting the computer.
You can use a batch file, that needs to be run as Admin, to replace the manual steps above:
DisableEnableWiFiCard.bat
Code:
:: The WiFi must be turned on first
prompt $g
Set /a Found=0
set FindString=Name
Set UseExpresssion=netsh wlan show interfaces
for /F "tokens=*" %%X IN ('%UseExpresssion% ^| find /i "%FindString%"') do Call :Interfaces "%%X"
GoTo EndGetWiFi
:Interfaces
Set ThisLine=%~1
Set AdapterName=%ThisLine:*: =%
GoTo :EOF
:EndGetWiFi
:: Do the disabling-enabling
netsh interface set interface "%AdapterName%" disabled
netsh interface set interface "%AdapterName%" enabled
::Pause to check outcome
I needed to do this with my last computer but no longer need to do so. I never managed to put together a reliable method detecting when the batch file was needed so just ran it when I could not connect. I hope the link dalchina gave you helps you get further than I did.
Best of luck,
Denis