@Echo Off
@ping 127.0.0.1 -n 3 -w 1000 > nul
Set WIFIDevicePath=HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}\

Set TargetValueName="Intel(R) Wireless"

Set DevNum=0000
reg query %WIFIDevicePath%%DevNum% /v DriverDesc | find %TargetValueName% >nul
if NOT ErrorLevel 1 goto FoundDevice

Set DevNum=0001
reg query %WIFIDevicePath%%DevNum% /v DriverDesc | find %TargetValueName% >nul
if NOT ErrorLevel 1 goto FoundDevice

Set DevNum=0002
reg query %WIFIDevicePath%%DevNum% /v DriverDesc | find %TargetValueName% >nul
if NOT ErrorLevel 1 goto FoundDevice

Set DevNum=0003
reg query %WIFIDevicePath%%DevNum% /v DriverDesc | find %TargetValueName% >nul
if NOT ErrorLevel 1 goto FoundDevice

Set DevNum=0004
reg query %WIFIDevicePath%%DevNum% /v DriverDesc | find %TargetValueName% >nul
if NOT ErrorLevel 1 goto FoundDevice

Set DevNum=0005
reg query %WIFIDevicePath%%DevNum% /v DriverDesc | find %TargetValueName% >nul
if NOT ErrorLevel 1 goto FoundDevice

Set DevNum=0006
reg query %WIFIDevicePath%%DevNum% /v DriverDesc | find %TargetDriverDesc% >nul
if NOT ErrorLevel 1 goto FoundDevice

Set DevNum=0007
reg query %WIFIDevicePath%%DevNum% /v DriverDesc | find %TargetDriverDesc% >nul
if NOT ErrorLevel 1 goto FoundDevice

Set DevNum=0008
reg query %WIFIDevicePath%%DevNum% /v DriverDesc | find %TargetDriverDesc% >nul
if NOT ErrorLevel 1 goto FoundDevice

Set DevNum=0009
reg query %WIFIDevicePath%%DevNum% /v DriverDesc | find %TargetDriverDesc% >nul
if NOT ErrorLevel 1 goto FoundDevice

Set DevNum=0010
reg query %WIFIDevicePath%%DevNum% /v DriverDesc | find %TargetDriverDesc% >nul
if NOT ErrorLevel 1 goto FoundDevice

Set DevNum=0011
reg query %WIFIDevicePath%%DevNum% /v DriverDesc | find %TargetValueName% >nul
if NOT ErrorLevel 1 goto FoundDevice

Set DevNum=0012
reg query %WIFIDevicePath%%DevNum% /v DriverDesc | find %TargetValueName% >nul
if NOT ErrorLevel 1 goto FoundDevice

Set DevNum=0013
reg query %WIFIDevicePath%%DevNum% /v DriverDesc | find %TargetValueName% >nul
if NOT ErrorLevel 1 goto FoundDevice

Set DevNum=0014
reg query %WIFIDevicePath%%DevNum% /v DriverDesc | find %TargetValueName% >nul
if NOT ErrorLevel 1 goto FoundDevice

Set DevNum=0015
reg query %WIFIDevicePath%%DevNum% /v DriverDesc | find %TargetValueName% >nul
if NOT ErrorLevel 1 goto FoundDevice

Set DevNum=0016
reg query %WIFIDevicePath%%DevNum% /v DriverDesc | find %TargetValueName% >nul
if NOT ErrorLevel 1 goto FoundDevice

goto END

:FoundDevice

reg add %WIFIDevicePath%%DevNum% /v WowlanS5Enabled /t REG_DWORD /d 1 /f

:END
@echo Done

EXIT /B
