running windows 'start' cmd using spawnl

Discussion in 'Python' started by Tor Erik, Aug 23, 2006.

  1. Tor Erik

    Tor Erik Guest

    Hi,

    I need to start a program in a new cmd-window. To do this I need to
    execute: start [command]
    With os.system this is straight-forward.
    But I need to do it with spawnl and P_NOWAIT. I.e, asynchronously.
    The problem is that I need to know the path where start resides,
    which I'm unable to find.

    Does anyone know where this command is located, or an alternative way of
    doing what I want?

    regards
    Tor Erik, Aug 23, 2006
    #1
    1. Advertising

  2. At Wednesday 23/8/2006 14:22, Tor Erik wrote:

    >I need to start a program in a new cmd-window. To do this I need to
    >execute: start [command]
    >With os.system this is straight-forward.
    >But I need to do it with spawnl and P_NOWAIT. I.e, asynchronously.
    >The problem is that I need to know the path where start resides,
    >which I'm unable to find.


    On Windows NT, XP, 2003 and others, there is no "start.exe"
    executable; it's an internal command. It only exists on 95, 98, maybe ME.
    Try the subprocess module.


    Gabriel Genellina
    Softlab SRL





    __________________________________________________
    Preguntá. Respondé. Descubrí.
    Todo lo que querías saber, y lo que ni imaginabas,
    está en Yahoo! Respuestas (Beta).
    ¡Probalo ya!
    http://www.yahoo.com.ar/respuestas
    Gabriel Genellina, Aug 23, 2006
    #2
    1. Advertising

  3. Tor Erik wrote:

    > I need to start a program in a new cmd-window. To do this I need to
    > execute: start [command]
    > With os.system this is straight-forward.
    > But I need to do it with spawnl and P_NOWAIT. I.e, asynchronously.
    > The problem is that I need to know the path where start resides,
    > which I'm unable to find.


    os.startfile(command) could work.

    </F>
    Fredrik Lundh, Aug 23, 2006
    #3
  4. Hi!

    You can use (exemple) :

    "cmd /cSTART notepad"

    --
    @-salutations

    Michel Claveau
    Michel Claveau, Aug 23, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nushin
    Replies:
    3
    Views:
    6,849
    nushin
    Aug 7, 2003
  2. Jonathan Ellis

    windows, spawnl, and sys.argv

    Jonathan Ellis, Nov 7, 2004, in forum: Python
    Replies:
    0
    Views:
    330
    Jonathan Ellis
    Nov 7, 2004
  3. Achim Domma (Procoders)

    read input for cmd.Cmd from file

    Achim Domma (Procoders), Jun 3, 2005, in forum: Python
    Replies:
    2
    Views:
    8,066
    Peter Otten
    Jun 3, 2005
  4. Sarir Khamsi

    Interpreter-like help in cmd.Cmd

    Sarir Khamsi, Jun 9, 2005, in forum: Python
    Replies:
    4
    Views:
    371
    Bengt Richter
    Jun 26, 2005
  5. =?ISO-8859-1?Q?Sch=FCle_Daniel?=

    [exec cmd for cmd in cmds]

    =?ISO-8859-1?Q?Sch=FCle_Daniel?=, Mar 8, 2006, in forum: Python
    Replies:
    3
    Views:
    387
    Scott David Daniels
    Mar 8, 2006
Loading...

Share This Page