command exit status on windows

Discussion in 'Python' started by Sami Viitanen, Sep 24, 2003.

  1. Hello,

    Is there a way to check if a command executed in ms-dos returns 0 (success)
    or greater than 0 (fail) ?

    In Unix the module commands.getstatusoutput returns exit status..


    Thanks in advance.

    -SV
     
    Sami Viitanen, Sep 24, 2003
    #1
    1. Advertising

  2. On Windows NT, 2000, 2003 and XP this generally works as well, although you'll find that some command line applications specifically written for Windows don't bother with a return code.

    I can't comment about Windows 95, 98 or ME.

    The os.system call (which works on both Unix and Windows) returns the correct status code.

    Felix
    > Hello,
    >
    > Is there a way to check if a command executed in ms-dos returns 0 (success)
    > or greater than 0 (fail) ?
    >
    > In Unix the module commands.getstatusoutput returns exit status..
    >
    >
    > Thanks in advance.
    >
    > -SV
     
    Felix McAllister, Sep 24, 2003
    #2
    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. Tim F.
    Replies:
    1
    Views:
    540
    Joe Smith
    Jan 29, 2004
  2. jacob navia
    Replies:
    3
    Views:
    557
    Nick Keighley
    Feb 24, 2010
  3. Keith Thompson
    Replies:
    10
    Views:
    698
    Tim Rentsch
    Mar 3, 2010
  4. lizheng
    Replies:
    0
    Views:
    804
    lizheng
    May 8, 2010
  5. kaleem
    Replies:
    8
    Views:
    822
    Tad McClellan
    Dec 14, 2006
Loading...

Share This Page