启动exe作为explorer.exe的子项

时间:2013-09-20 09:05:16

标签: python python-2.7

我尝试启动一个exe文件(不是来自我),它需要是explorer.exe的子进程才能正常运行。

如果我使用os.startfilewin32api.Shellexecute,则无效。

我发现了这个:http://www.nirsoft.net/utils/run_from_process.html

跑步:

from win32api import ShellExecute

RFPexp = r"D:\RunFromProcess-x64.exe"
myFilePath = "path\to\myfile.exe"

args = "nomsg explorer.exe %s" %myFilePath
ShellExecute(0,'Open', RFPexp, args, None, 1)

然后myfile.exe是explorer.exe的子进程,一切正常。

问题在于它依赖于这个实用程序,我不知道它是否会被维护,保持空闲,将来与Windows保持兼容等等。

那我怎么能用python本身呢?

由于

0 个答案:

没有答案
相关问题