I'm trying to use a netsh script to change the IP address on a box that's headless. This works fine, unless there's an IP conflict. When an IP address conflict occurs, I see a dialog box that says "The static IP address that was just configured is already in use on the network. Please reconfigure a different IP address." In this case, netsh just hangs waiting for someone to acknowledge the dialog box.
I won't be the one using the script, and the users who are will definitely cause an IP conflict sometimes. Is there a way to get netsh to just return an error code instead? Anything would be better than just hanging.