473,395 Members | 1,368 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Trouble with using "system function"

Dear Friends,
I need to execute an executable file (*.exe) within visual c++ program.
I have used " system function " for this purpose and it works in most of the
time but sometimes while performing this command it can't close the
MS DOS prompt window and return from it .
I want to know how I can solve this problem and
if there is another way to execute (*.exe) within visual c++ program.

Thanks.
Jul 22 '05 #1
1 1734
"Leila Y" <ly*****@yahoo.com> wrote in message
news:2d**************************@posting.google.c om...
Dear Friends,
I need to execute an executable file (*.exe) within visual c++ program.
I have used " system function " for this purpose and it works in most of the time but sometimes while performing this command it can't close the
MS DOS prompt window and return from it .
I want to know how I can solve this problem and
if there is another way to execute (*.exe) within visual c++ program.

Thanks.


Hello

AFAIK, system() (in Windows OS) will use the program specified in %COMSPEC%
environment variable with a /C parameter to launch your program.

A better alternative to execute a program is to use the Windows' specific
functions WinExec(), CreateProcess() or ShellExecute[Ex].

For more information about this, try posting in
microsoft.public.win32.programmer.kernel

Regards,
Elias
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jerry Sievers | last post by:
Hello. Maybe I'm just out of practice, maybe not. Suppose we run a command using system() and this command writes to the stderr stream. If I remember correctly, this is normally written to the...
11
by: T O | last post by:
Hi all, I am very new to C programming and have come across problem. My programme has opened and created a text document on the hard drive. The document name is stored in a string called...
2
by: JohnB | last post by:
hi I am using System.Web.Mail.MailMessage to send email. Is there any way to keep the email to "Sent Items" Folder?? I use Microsoft Outlook as my email tool. Thanks
1
by: Liang Zhang | last post by:
HI, ALL I found a surprising problem when using function "_tfindfirst()" and "_tfindnext()" to enumerate all the files in a specified directory, the code is like below: handle =...
3
by: Acrobatic | last post by:
Hello I've got a simple Perl script that works fine from the command line but not from PHP via the browser. It's a conversion program that converts an image to a different format, and writes the...
14
by: Ronald S. Cook | last post by:
I'm just curious how you would handle this. In the cable industry, Comcast is referred to as an "MSO" (multiple systems operator) meaning they own many cable systems. Therefore a solution must be...
13
by: darktemplarcs | last post by:
Hey, does anyone know an alternative function in C++ that can execute window programs other then using "system()"? Thanks
12
by: Jon Slaughter | last post by:
is there any way to simply add an attribute like feature to a function/method definition? say I create a function like function Test() { //.... }
3
by: mvjohn100 | last post by:
Dear Friends, For moving files I used the following code sprintf(cpy,"mv %s%0.2f %s%0.2f","/var/data/lo,versionold,"/var/data/lo2",versionnew); system(cpy); Is there any problem using...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.