Connect the USB device, do not use your program to connect to internet , instead use above command from command prompt and see if the connection gets connected.you can verify so by pinging google or any other website.
if it works then we can create our script.
Before that open network properties,right click on Wnet connetion and hit properties.
Go to options tab and thn remove all check boxes.
Let me know if it works..