About wmi

Tim Golden mail at timgolden.me.uk
Mon Jul 14 07:18:53 EDT 2008


Larry Bates wrote:
> patrol wrote:
>> I want to prevent some process from running. The code is in the
>> following. I  encounter some unexpected troubles.
>> Probelm1: This program cannot terminate "scrcons.exe" and
>> "FNPLicensingService.exe",which are system processes.
>> Problem2:After a while, this program will abort by error
>>   File "C:\Python25\lib\wmi.py", line 397, in __call__
>> handle_com_error (error_info)
>>   File "C:\Python25\lib\wmi.py", line 190, in handle_com_error raise
>> x_wmi, "\n".join (exception_string)
>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xb7 in position
>> 14: ordinal not in range(128)

[... snip code ...]

> You should probably post this to comp.python.windows.  Tim Golden 
> (author of WMI interface) monitors that list religously (thanks Tim).


Actually, I follow this one pretty much, too. I've just been a bit busy
these last few days. And still am, so this answer will be short :)


1) I'm not sure if WMI can be forced to close down system processes,
but if it can it's probably by means of specifying one or more
privileges when you connect. Try looking in the WMI newsgroups
for a more general (non-Python) answer to this and I'll happily
explain how to apply it in a Python context.

2) I can't quite see from this traceback where the problem
arises. Have you snipped the traceback at all, or was that
all there was? Can you narrow the thing down to a short
snippet of code which I'm likely to be able to run independently,
please?

Sorry for the haste.

TJG



More information about the Python-list mailing list