Have you seen that you are using the same query condition in both cases?
You should try to enable only what is not enabled ("
...Where NetEnabled=False
"). See the NetEnabled property here:
http://msdn.microsoft.com/en-us/library/aa394216(v=vs.85).aspx[
^]. I know that you have used the code from MSDN (
http://msdn.microsoft.com/en-us/library/aa390385(v=vs.85).aspx[
^]), but I think it is wrong.
Be aware, that the system has several adapters. Use
WmiExplorer[
^] for example to check all adapter status. You should store somewhere the id of the device you disable to know which to enable.