CreateProcess in NT Service

Syver Enstad syver.enstad at sensewave.com
Thu Aug 10 16:37:52 EDT 2000


> h = win32process.createprocess('c:\\python\\myprogram.py',None,None,
>                   None,1,0,None,None,si)


> I can start other programs this (notepad,wordpad) way from the
> interactive window.

myprogram.py isn't a program(Win32 executable) like notepad/wordpad it's
just a text file so can't create a process from it.

Try something like this instead.
h = win32process.CreateProcess(None, 'G:/program files/PYTHON/python.exe
G:/Documents and Settings/Syver Enstad/Desktop/testEvent.py', None, None, 1,
0, None, None, si)

Note that I have changed the command from using parameter one to parameter
two as this enables searching of the path to locate the executable module.
(Doesn't matter in this case, but nice to know)









More information about the Python-list mailing list