command exit status on windows

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sami Viitanen

    command exit status on windows

    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.getsta tusoutput returns exit status..


    Thanks in advance.

    -SV


  • Felix McAllister

    #2
    Re: command exit status on windows

    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[color=blue]
    > 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.getsta tusoutput returns exit status..
    >
    >
    > Thanks in advance.
    >
    > -SV[/color]

    Comment

    • Felix McAllister

      #3
      Re: command exit status on windows

      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[color=blue]
      > 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.getsta tusoutput returns exit status..
      >
      >
      > Thanks in advance.
      >
      > -SV[/color]

      Comment

      Working...