title: Python Changing IP Address using WMI
body: <p>I am attempting to use WMI to change the IP address of my PC.
  The code below is run from the command line on Windows:</p>
  
  <pre><code>import wmi
  c = wmi.WMI().Win32_NetworkAdapterConfiguration(IPEnabled=1)
  nic = c[1]
  ip = "192.168.1.1"
  subnetmask = "255.255.255.0"
  nic.EnableStatic(IPAddress=[ip], SubnetMask=[subnetmask])
  </code></pre>
  
  <p>The above code then returns the following result:</p>
  
  <pre><code>(-2147024891,)
  </code></pre>
  
  <p>I believe this error is related to permissions.</p>
  
  <p>When I run the command line as Administrator, and enter the above code again, I am presented with the value:</p>
  
  <pre><code>(0L,)
  </code></pre>
  
  <p>This value indicates that the IP change was successful.</p>
  
  <p>Is there a way for me to change the IP address without first running the command line as Administrator?</p>