Solved

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

Posted on 2000-03-19
2
211 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

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…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

773 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