开发者

parameter transferring in the wmi

开发者 https://www.devze.com 2023-03-22 10:22 出处:网络
hello everyone I have some problem with understanding this piece of the开发者_如何学C code: import wmi

hello everyone I have some problem with understanding this piece of the开发者_如何学C code:

import wmi
c = wmi.WMI ()

process_id, return_value = c.Win32_Process.Create (CommandLine="notepad.exe")
for process in c.Win32_Process (ProcessId=process_id):
  print process.ProcessId, process.Name

result = process.Terminate ()

I can't understand

(CommandLine="notepad.exe")

how exactly this mechanism is working? and where can I find definition of the CommandLine thanks in advance for any help


It is sent as part of **kwargs of def new (self, **kwargs): as you can see in the wmi.py. The convention is always what Microsoft has defined for the process creation and you can find that in the MSDN documentation.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号