472,353 Members | 1,391 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 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 6999
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...
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...
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...
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 ...
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...
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...
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...
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 ...
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...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

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.