Re: About wmi

2008-07-18 Thread patrol
On 7月17日, 下午4时22分, Tim Golden <[EMAIL PROTECTED]> wrote: > patrol wrote: > > I will try to modify the wmi.py ,however I'm a novice.It will take a > > long time. You can give it up temporarily. If you don't mind ,can you > > tell me where needs modifying and how? Just unicode? Or Other? > > OK. Than

Re: About wmi

2008-07-17 Thread Tim Golden
patrol wrote: I will try to modify the wmi.py ,however I'm a novice.It will take a long time. You can give it up temporarily. If you don't mind ,can you tell me where needs modifying and how? Just unicode? Or Other? OK. Thanks for your patience on this one, Patrol. What I propose to do is to di

Re: About wmi

2008-07-16 Thread patrol
I will try to modify the wmi.py ,however I'm a novice.It will take a long time. You can give it up temporarily. If you don't mind ,can you tell me where needs modifying and how? Just unicode? Or Other? -- http://mail.python.org/mailman/listinfo/python-list

Re: About wmi

2008-07-16 Thread patrol
On 7月17日, 上午3时20分, Tim Golden <[EMAIL PROTECTED]> wrote: > patrol wrote: > > On 7月17日, 上午12时16分, Tim Golden <[EMAIL PROTECTED]> wrote: > >> Assuming that the error comes back in the sys.stdout encoding, the > >> following version *should* work ok. I still haven't got a non-English set > >> up to

Re: About wmi

2008-07-16 Thread Tim Golden
patrol wrote: > On 7月17日, 上午12时16分, Tim Golden <[EMAIL PROTECTED]> wrote: >> Assuming that the error comes back in the sys.stdout encoding, the following >> version *should* work ok. I still haven't got a non-English set up to test >> it on, but it certainly does return a Unicode error message. >

Re: About wmi

2008-07-16 Thread Tim Golden
patrol wrote: import wmi wmi.WMI('non-existent computer') > Traceback (most recent call last): > File "", line 1, in > File "C:\Python25\lib\wmi.py", line 1199, in connect > handle_com_error (error_info) > File "C:\Python25\lib\wmi.py", line 184, in handle_com_error > excep

Re: About wmi

2008-07-16 Thread patrol
On 7月17日, 上午12时16分, Tim Golden <[EMAIL PROTECTED]> wrote: > Assuming that the error comes back in the sys.stdout encoding, the following > version *should* work ok. I still haven't got a non-English set up to test it > on, but it certainly does return a Unicode error message. > > http://timgolden

Re: About wmi

2008-07-16 Thread patrol
On 7月16日, 下午11时59分, Tim Golden <[EMAIL PROTECTED]> wrote: > patrol wrote: > > -2147023174 > > 'RPC \xb7\xfe\xce\xf1\xc6\xf7\xb2\xbb\xbf\xc9\xd3\xc3\xa1\xa3' > > None > > None > > > -- > > import pythoncom > > import win32com.client

Re: About wmi

2008-07-16 Thread Tim Golden
Assuming that the error comes back in the sys.stdout encoding, the following version *should* work ok. I still haven't got a non-English set up to test it on, but it certainly does return a Unicode error message. http://timgolden.me.uk/wmi-project/wmi.py The usual test case, if you wouldn't min

Re: About wmi

2008-07-16 Thread Tim Golden
patrol wrote: > -2147023174 > 'RPC \xb7\xfe\xce\xf1\xc6\xf7\xb2\xbb\xbf\xc9\xd3\xc3\xa1\xa3' > None > None > > -- > import pythoncom > import win32com.client > > > try: > win32com.client.GetObject ("winmgmts://blahblah") > exc

Re: About wmi

2008-07-16 Thread patrol
On 7月16日, 下午10时39分, Tim Golden <[EMAIL PROTECTED]> wrote: > patrol wrote: > > The errors are in the following: > > > Traceback (most recent call last): > > File "D:\My Documents\code\python\wmi\test.py", line 5, in > > c = wmi.WMI ("non-existent computer") > > File "C:\Python25\lib\wmi.py"

Re: About wmi

2008-07-16 Thread Tim Golden
patrol wrote: > The errors are in the following: > > Traceback (most recent call last): > File "D:\My Documents\code\python\wmi\test.py", line 5, in > c = wmi.WMI ("non-existent computer") > File "C:\Python25\lib\wmi.py", line 1199, in connect > handle_com_error (error_info) > File

Re: About wmi

2008-07-16 Thread patrol
On 7月16日, 下午3时29分, Tim Golden <[EMAIL PROTECTED]> wrote: > patrol wrote: > >>http://timgolden.me.uk/wmi-project/wmi.py > > > It cannot work either. > > Oh well. It was only a quick fix! I'll try > to get some kind of non-ASCII edition of Windows > to test against. As I understand it, the situation

Re: About wmi

2008-07-16 Thread Tim Golden
patrol wrote: http://timgolden.me.uk/wmi-project/wmi.py It cannot work either. Oh well. It was only a quick fix! I'll try to get some kind of non-ASCII edition of Windows to test against. As I understand it, the situation is that some WMI exception (ie coming from the underlying WMI/COM subsy

Re: About wmi

2008-07-15 Thread patrol
> At any rate, try using: > > result, = new_process.Terminate () Windows is sometime case insensitive,but the python is case sensitive. I also encountered this kind of problems. Thanks for Tim's help. Patrol -- http://mail.python.org/mailman/listinfo/python-list

Re: About wmi

2008-07-15 Thread patrol
> http://timgolden.me.uk/wmi-project/wmi.py It cannot work either. > which is a copy of the svn trunk to see if that > improves the UnicodeDecode error, please? I'll > try to get an install of a non-English edition of > Windows but, as you might imagine, I normally run > the UK version so don't h

Re: About wmi

2008-07-15 Thread Tim Golden
patrol wrote: Situation (1): result = new_process.terminate() TypeError: 'int' object is not callable I'm not sure exactly what's causing that particular effect, but I would suggest that you call the method as .Terminate (note the initial capital). On my box, calling .terminate simply raise

Re: About wmi

2008-07-15 Thread Tim Golden
patrol wrote: Situation (2): result = new_process.terminate() File "C:\Python25\lib\wmi.py", line 494, in __getattr__ 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' co

Re: About wmi

2008-07-14 Thread patrol
Situation (1): result = new_process.terminate() TypeError: 'int' object is not callable Situation (2): result = new_process.terminate() File "C:\Python25\lib\wmi.py", line 494, in __getattr__ handle_com_error (error_info) File "C:\Python25\lib\wmi.py", line 190, in handle_com_erro

Re: About wmi

2008-07-14 Thread patrol
Hi, > 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

Re: About wmi

2008-07-14 Thread Tim Golden
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

Re: About wmi

2008-07-14 Thread patrol
On 7月14日, 下午12时29分, Larry Bates <[EMAIL PROTECTED]> wrote: > patrol wrote: > > On 7月13日, 下午10时26分, Larry Bates <[EMAIL PROTECTED]> wrote: > >> patrol wrote: > >>> I want to prevent some process from running. The code is in the > >>> following. I encounter some unexpected troubles. > >>> Probelm1:

Re: About wmi

2008-07-13 Thread Larry Bates
patrol wrote: > On 7月13日, 下午10时26分, Larry Bates <[EMAIL PROTECTED]> 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 >>> "FNPLicensingServic

Re: About wmi

2008-07-13 Thread patrol
On 7月13日, 下午10时26分, Larry Bates <[EMAIL PROTECTED]> 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

Re: About wmi

2008-07-13 Thread Larry Bates
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

About wmi

2008-07-13 Thread patrol
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:\Pytho