These functions in win32process should be able to get that for you: OpenProcess, EnumProcessModules and GetModuleFileNameEx The executable will be the first module returned from EnumProcessModules. Roger
Gabriel Reis wrote:
Hi,
I want to get the executable filename and its path from a process. Imagine that I have an application installed in two different directories. The rule is: the user can't run an instance of this application if another instance, from the *same* directory, is already running.
I've read PyWin32 documentation and browsed this maillist's history and I couldn't find anything specifically. With the method MakeCounterPath I can get information (items) such as Memory, Process ID or % CPU... so I am wondering if I can get the executable path too, once I have the PID.
Best regards,
Gabriel Reis
_______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32