Solved

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

Posted on 2000-03-19
2
189 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
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now