Win32_Process.Create -- not starting process

abcd codecraig at gmail.com
Tue Feb 14 11:25:30 EST 2006


I am using Python to create a process on another computer.  Both
computers are on the same domain with admin privileges.

On computer B I have a batch script which starts a python script.  From
computer A I am doing the following:

import wmi
w = wmi.WMI("1.2.3.4")
p = w.new("Win32_Process")
pid, retVal = p.Create(CommandLine="C:\\a_script.bat")
print pid, retVal

The output I get is, 1218 0  ....0 = "Successful Completion"
....however the python script that is called from the batch script
never seems to run or at least only for a split second.  Sometimes I
see python.exe appear in the task manager on computer B for a split
second then it goes away.  So I went to computer B and double clicked
on the batch script, and sure enough a command opened up and the python
script was running...and stayed running...no problem.   I should
mention, that sometimes it will execute the batch script and the Python
script will run and stay running.  That has only happened after trying
to do "p.Create(CommandLine....)" more than once, but not every time I
try.

Any ideas why its not working for me remotely....or why its random?
These are win xp machines with no firewalls running.




More information about the Python-list mailing list