[python-win32] win32com can't find file but I can see it, confused

dave selby dave6502 at gmail.com
Fri Mar 9 14:17:52 CET 2012


OK I am a little confused, I have the following

shell = win32com.client.Dispatch('WScript.Shell')
print os.path.isfile(self.exe)
print self.exe
shell.Run(self.exe)

The file self.exe exists, I get a 'true' from os.path.isfile, I can
execute it on the command line AOK, its path is as I would expect but
when I attempt to execute it I get ...

True
C:\Documents and Settings\dave\Desktop\My Mobile\MyMobiler\MyMobiler.exe
Traceback (most recent call last):
 File "C:\Program Files\FX Hammer\core\diag.py", line 64, in <module>
   my_mobiler_.startExe()
 File "C:\Program Files\FX Hammer\core\my_mobiler.py", line 93, in startExe
   shell.Run('C:\Documents and Settings\dave\Desktop\My
Mobile\MyMobiler\MyMobiler.exe')
 File "<COMObject WScript.Shell>", line 2, in Run
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, None,
None, None, 0, -2147024894), None)

Now using win32api.FormatMessage() I get ...

Exception occurred.

The system cannot find the file specified.

Am I missing anything ?

Cheers

Dave



-- 

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html



-- 

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html


More information about the python-win32 mailing list