How to pass parameters between 2 exe files by command prompt or other ways

Posted on 2005-04-20
Medium Priority
Last Modified: 2013-11-20
Hi Experts,

May I know how to pass parameter between 2 exe files.
I need a sinple way, such as command prompt.
May you give any sample code?

Thanks and Regards,

Question by:turbot_yu

Assisted Solution

rollocool earned 400 total points
ID: 13830897

Assisted Solution

NawalKishore1976 earned 200 total points
ID: 13831340
its easy:

in c++ you can either use system(p.exe arglist)
or CreateProcess(exename, arg, ..)

LVL 45

Assisted Solution

AndyAinscow earned 200 total points
ID: 13831431
Between two running apps look at the WM_COPYDATA in help.  It has a link to example code.
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.

LVL 60

Assisted Solution

by:Julian Hansen
Julian Hansen earned 400 total points
ID: 13831718
You have cross posted this to


This is not considered to be a good idea by the EE community.

What you should do is post a pointer question (20 pts) to the main question and refer people there. This way you cause confusion.

Author Comment

ID: 13831900
sorry, i am not sure where is more protable to post
LVL 60

Assisted Solution

by:Julian Hansen
Julian Hansen earned 400 total points
ID: 13831934
You can post to multiple threads but what you need to do is make one of the threads the primary - that is the one you offer the majority of points for.

You can then post what is called pointer questions in other relevant threads that refer to the main question (cut and past the URL from the main question to the pointer question). Allocate 20pts for the pointer and state that it is a pointer to another question.

This way you can get the discussion for the question in a single thread.


Accepted Solution

reidy_boy earned 800 total points
ID: 13832524
Register a windows message, then use FindWindow to locate a handle to the window of each app.  Set up a shared memory area.  Post a message like WM_DATAAVAILABLE.  When an app gets the message they check the shared memory area for the data.

Or if the data you are trying to send is small, the standard way is to use windows sockets.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month16 days, 7 hours left to enroll

850 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