import os
cmd = '"c:\\command.exe" "parameter inside quotes"'
os.popen4(cmd)
Results in the following error message:
'c:\\command.exe" "parameter inside quotes' is not recognized as an
internal or external command,
operable program or batch file.
// Dalle
Hmm... not for me... I get:
>>> import os
>>> cmd = '"c:\\command.exe" "parameter inside quotes"'
>>> os.popen4(cmd)
(<open file '"c:\command.exe" "parameter inside quotes"', mode 'w' at
0x008E6620>, <open file '"c:\command.exe" "parameter insid
e quotes"', mode 'r' at 0x008EC060>)
Emile van Sebille
em...@fenx.com
> cmd = '"c:\\command.exe" "parameter inside quotes"'
> os.popen4(cmd)
> 'c:\\command.exe" "parameter inside quotes' is not recognized as an
> internal or external command, operable program or batch file.
Not surprising. Pick command.COM or cmd.exe.
-D
--
If your life is a hard drive,
Christ can be your backup.
www: http://dman13.dyndns.org/~dman/ jabber: dm...@dman13.dyndns.org
*siq* I should have written anycommand.exe instead of command.exe...
Did you try with having the exe-file in another directory with spaces:
"c:\path with spaces\command.exe"?
What Windows version are you running?
// Dalle
Take a look at this (especially Tim Peters' very thorough explanation in
the Followups section):
http://sf.net/tracker/?func=detail&aid=512433&group_id=5470&atid=105470
Perhaps this is what you are seeing? One workaround (that isn't
beautiful) might be to create a temporary batch file with your command
line and execute that batch file.
Jimmy
This wraps, but here's the result:
Python 2.4a0 (#46, Oct 25 2003, 09:39:59) [MSC v.1200 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> cmd = '"C:\\Program Files\\Microsoft Visual
Studio\\Common\\Tools\\dfview.ex
e" "parameter inside quotes"'
>>> os.popen4(cmd)
(<open file '"C:\Program Files\Microsoft Visual
Studio\Common\Tools\dfview.exe"
"parameter inside quotes"', mode 'w' at 0x008E4EE0>, <open file '"C:\Program
Fil
es\Microsoft Visual Studio\Common\Tools\dfview.exe" "parameter inside
quotes"',
mode 'r' at 0x008EC660>)
>>>
>
> What Windows version are you running?
>
This was on winxppro.
Emile