unable to start script with win32com as windows service
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
Hi, I am using win32com with pywin32-220.win-amd64-py2.7.exe setup in my env. Here is my test code with win32com.client calling wmi service.
````
conn = client.GetObject('winmgmts://127.0.0.1/root/cimv2')
fcvm = conn.ExecQuery("select * from Win32_PerfFormattedData_HvStats_HyperVHypervisorLogicalProcessor")
for x in fcvm:
if x.Name == "_Total":
cpu = x.PercentTotalRunTime
````
this code can run as a script but when I install this with nssm.exe as a windows service, it cannot start. In the windows event log I can check this not running at all. Can someone point me out of this? Thanks.
Andes
This is likely to be because services run with far less permissions by default - you should arrange to catch exceptions and dump them somewhere you can see them. You might also like to resend your question to the python-win32 mailing list. You need to be subscribed to the list before you can post to it - see http://mail.python.org/mailman/listinfo/python-win32 for subscription options.
Thanks Mark!