473,387 Members | 1,791 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,387 software developers and data experts.

Run an exe through another C++ program

2
Hi,
I want to run another .exe with some arguments through a c++ program. Can anybody tell me the procedure to do it?
May 16 '07 #1
2 1724
gpraghuram
1,275 Expert 1GB
Hi,
You can use system() function call to achieve the same.
Look at this code
Expand|Select|Wrap|Line Numbers
  1. char arr[100];
  2. sprintf(arr,"%s %d %d","abc.exe",2,2);
  3. system(arr);
  4.  
In the above example abc.exe is the executable u want to call,give the full path of the executable and the 2,2 are the arguments.
Hope this helps u.

Thanks
Raghuram
May 16 '07 #2
here4c
2
Hi,
You can use system() function call to achieve the same.
Look at this code
Expand|Select|Wrap|Line Numbers
  1. char arr[100];
  2. sprintf(arr,"%s %d %d","abc.exe",2,2);
  3. system(arr);
  4.  
In the above example abc.exe is the executable u want to call,give the full path of the executable and the 2,2 are the arguments.
Hope this helps u.

Thanks
Raghuram



Thanks billions!!!!
May 16 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: John | last post by:
Hello, I need to know which programs are opn on another machine in my network, these programs are opened from a shared drive on the server. How can I do this ? I've already dowloaded a sample...
8
by: Peter Nolan | last post by:
Hi All, I have written some software that performs ETL processing to load data warehouses. Each program accepts a set of parameters and returns 0 or 1 to the win/unix shell to indicate success or...
1
by: Jung Joon Park | last post by:
Hi everyone. I am JJ Park. I got some questions in C++. First of all, my English is not perfect, because I am foreigner. I have got C++ code, which have no syntex error in Visual C++ ver6.0...
6
by: dwelch91 | last post by:
Greetings- This is on Linux... I have a daemon running as root and I want to execute another Python program as another user (a regular user). I have the name of the user and can use the 'pwd' and...
22
by: Boris | last post by:
I'm porting code from Windows to UNIX and ran into a problem with dynamic_cast. Imagine a class hierarchy with three levels: class Level2 derives from Level1 which derives from Base. If you look...
1
by: Netaro | last post by:
Well... So, i have a program. A normal program, which does something, and so.. and i have another program, which wants to run the first program.... So, there are 2 questions about that problem...
0
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
Hi, We want to write a program (Prog_A) to check the activities of another program (Prog_B). If there is no activity on the Prog_B for a period of time, the Prog_A need send a message to close...
5
by: Mirxon | last post by:
Hello, I'm working on a C program under Ubuntu. It's basd on socket. Browser calls a client cgi (C program), and send some parameters to server (C program). Server runs another program...
11
by: fniles | last post by:
One of our application uses VB6 and Access97 database. Another application uses VB.NET 2005. This morning for about 15 seconds when the application tries to read either a query or a table from the...
2
by: John Wright | last post by:
I have a central program I am starting to develop that will track processing deviations. This program is VB 2008 and needs to be called from VB 2005 programs and VB2008 programs (we have some VB 6...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.