Because you want to do it on systems with different Windows versions, using
netsh is the best option. Otherwise, you would have to write Windows version dependant code to change the network configuration while the
netsh from the Windows version will always work as expected.
The problem is that there are many services affected by changing network interface settings. You have to know all these services and restart them. Because detecting those services is nearly impossible (especially when there are 3rd party services), a reboot is the recomended action to avoid unwanted side effects.
If you still want to try it, have a look at this SE thread:
cmd.exe - Windows 7 'netsh reset' without rebooting? - Super User[
^]. That is for Windows 7. So you have to create a similar list for each Windows version that must be supported.