I followed directions to download WMI for Python here
When I attempt to run the code
import wmi
c = wmi.WMI ()
for s in c.Win32_Service (StartMode="Auto", State="Stopped"):
if raw_input ("Restart %s? " % s.Caption).upper () == "Y":
s.StartService ()
I receive the error
Traceback (most recent call last):
File ".\see_wmi.py", line 1, in
import wmi
ImportError: No module named wmi
EDIT:
I am using Python 2.7.6
EDIT2:
I am running 64-bit Windows 2008 R2, and I downloaded WMI-1.4.9.zip (md5) from https://pypi.python.org/pypi/WMI/. I extracted the contents and saved it in D:\Python\Tools\Scripts. I executed
python setup.py.install
I added D:\Python\Tools\Scripts to %PATH%, and when I execute the code</