I have to do this programmatically, context is that Digilent device can be used by physical user throught the GUI and forget to close the GUI after their debug session. After that I have an automated process(started by a regression server like Jenkins) that will try to use the device locked by Waveform so regression will fail
By the way, I found a workaround that seems stable (I have started the test in loop several times without any issues)
Workaround is:
-Try to open Digilent device
-Catch error when device is busy
-Disable Digilent device using pnputil
-Kill Waveform using taskkill
-Enable Digilent device using pnputil
-Open Digilent device
Regards
Danny