Solved

How can i execute the system command from 'C' programme

Posted on 2000-03-19
2
218 Views
Last Modified: 2010-04-15
How to run system command from 'C' prgramme. When i use 'System(command)'
in the programme, it is getting  executed but DOS screen flashes momentarily and control comes to programme. How to execute the same in
back ground without DOS screen flashing.
0
Comment
Question by:tarigopula
2 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 50 total points
ID: 2633428
When you call the system() is does the following (excerpted from the system doc page in the SDK):

"The system function passes command to the command interpreter, which executes the string as an operating-system command"

The command interpreter, (either COMMAND.COM on Win9x or CMD.EXE on NT) get run and it starts the command you give it.  If you don't want the flash of the command interpreter window, don't call system().

Use one of the other methods of starting your program.  Most likely you should be using CreateProcess() or ShellExecuteEx().  Either will start a new program without any command interpreter and hence, no flashing.
0
 
LVL 1

Expert Comment

by:ntdragon
ID: 2633431
i don't know 'cause you are runing a dos commands so a dos shell should be opened and if your program opened a window it will be in it<> it won't open another window>
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C hashtable library 3 100
why "." vs "->" 23 120
sameEnds challenge 3 180
outlook office 365 8 146
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question