?
Solved

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

Posted on 2000-03-19
2
Medium Priority
?
240 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 100 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
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 opening and writing to files in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
Suggested Courses

770 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