Passing arguments to exe

kyosohma at gmail.com kyosohma at gmail.com
Tue Dec 18 15:10:40 EST 2007


On Dec 15, 6:46 pm, Dennis Lee Bieber <wlfr... at ix.netcom.com> wrote:
> On Fri, 14 Dec 2007 16:38:28 -0800 (PST), kyoso... at gmail.com declaimed
> the following in comp.lang.python:
>
> > The executable runs, but no argument appears to get passed into it. Of
> > course, I don't really know that for sure as the executable doesn't
> > redirect stdout/stderr. I tried doing something like this in the above
> > reg entry:
>
> > cmd /C "c:\program files\myProg.exe %1"
> > "c:\program files\myProg.exe %1"
> > "c:\program files\myProg.exe"
>
>         What happens if you put the %1 OUTSIDE the quotes...
>
> cmd /c "c:\program files\myProg.exe" "%1"
>
> After all, if the quotes are being used to keep the command line seeing
> "program files" as a single term in the path, then your quotes are also
> treating "myProg.exe %1" as a single term.
> --
>         Wulfraed        Dennis Lee Bieber               KD6MOG
>         wlfr... at ix.netcom.com             wulfr... at bestiaria.com
>                 HTTP://wlfraed.home.netcom.com/
>         (Bestiaria Support Staff:               web-a... at bestiaria.com)
>                 HTTP://www.bestiaria.com/

This works:

"c:\program files\myProg.exe" %1

Thanks for the tip.



More information about the Python-list mailing list