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. Advertisements

  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. Advertisements

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:
    631
    Joe Smith
    Jan 29, 2004
  2. =?Utf-8?B?U2FuZHk=?=

    Code to Exit Web App and Exit Internet Explorer

    =?Utf-8?B?U2FuZHk=?=, Aug 3, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    8,277
    =?Utf-8?B?U2FuZHk=?=
    Aug 5, 2005
  3. Joe Smith
    Replies:
    4
    Views:
    66,862
    sandeep1976
    Nov 8, 2006
  4. jacob navia
    Replies:
    3
    Views:
    788
    Nick Keighley
    Feb 24, 2010
  5. Keith Thompson
    Replies:
    10
    Views:
    928
    Tim Rentsch
    Mar 3, 2010
  6. lizheng
    Replies:
    0
    Views:
    963
    lizheng
    May 8, 2010
  7. kaleem
    Replies:
    8
    Views:
    1,222
    Tad McClellan
    Dec 14, 2006
  8. Skye Shaw!@#$

    Backticks and exit status on Windows

    Skye Shaw!@#$, Aug 11, 2013, in forum: Ruby
    Replies:
    0
    Views:
    435
    Skye Shaw!@#$
    Aug 11, 2013
Loading...