473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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.getstatusoutput returns exit status..
Thanks in advance.

-SV
Jul 18 '05 #1
2 7050
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

Jul 18 '05 #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

Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Andreas Paasch | last post by:
According to the manual for PHP, I should be able to run a shell command within php. I'm trying to copy some php files from one location to another one using exec() but fail. ...
0
by: Sami Viitanen | last post by:
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...
1
by: Sandie Towers | last post by:
We use a number of similar databases and frequently create a new database using a backup restore of another similar database. We try to keep changes between databases in _Additional tables - like...
2
by: Stu | last post by:
I am running a simple c program on Solaris 2.8 that calls a ksh shell script x which contains an exit statement of 58 (exit 58). cat xxx.c #include <stdio.h> #include <errno.h> int
1
by: xtra | last post by:
Hi Folk I have written a module that allows you to type a bunch of commands in the immediate window, for quick access to information when you are creating VB code. Here it is, it may be helpful...
8
by: drose0927 | last post by:
Please help! I can't get my program to exit if the user hits the Escape button: When I tried exit(EXIT_SUCCESS), it wouldn't compile and gave me this error: Parse Error, expecting `'}''...
8
by: Atanas Banov | last post by:
i ran onto this weirdness today: seems like close() on popen-ed (pseudo)file fails miserably with exception instead of returning exit code, when said exit code is -1. here is the simplest...
2
by: loial | last post by:
In unix shell script I can do the following to get the status and values returned by a unix command OUTPUT=`some unix command` STATUS=$? if then exit 1 else set $OUTPUT
10
by: jimmy | last post by:
Hi again, sorry for posting two questions so close together but im working on a school project which is due in soon and running into some difficulties implementing the database parts. I have the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.