I tried the updated script and the WMI part causes a Error. The application just ends with the machine stating that there was a serious problem. Seems like the last part which sets the default gateway needs some work. Instead of WMI anyone have any quick ways to set the gateways . Thanks