My USB network adapter (latest drivers) disappear from "network connections" window in control panel when computer wake up from sleep. So construct batch file to resetting adapter using devcon. After adapter reset I want to add some IP subnets programatically using netsh. Problem is the adapter probably need some time after reset (disable && enable commands) is performed, because netsh failed if started earlier than some (let say 6 seconds, old Atom CPU is used) time. Now I have inserted timeout using 'timeout /T' command but this time could vary by system load. Question is: Is there any way to detect adapter status programatically from batch file?
set "netcmd=netsh in ip add address ETH1 192.168.0.100 255.255.255.0"
devcon disable "USB\VID_9710&PID_7830" >NUL
devcon enable "USB\VID_9710&PID_7830" >NUL
timeout /T 6 >NUL
%netcmd%