Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to pass a paramter to an exe

Status
Not open for further replies.

fromkc

Programmer
Jan 10, 2002
10
0
0
US
Using C in Visual studio environment i have the following code to run an executable eccard.exe. I can use 'system' to
actually run the command from inside my program.
My problem is after running : eccard stop , it pops up a console asking for sure : Y/N and i have to type in Y, to continue this process.

I would like to send my answer in my program so that the user may not have to do anything.

Following is what i tried, but it does not seem to work.

system(&quot;c:\\winnt\\system32\\eicon\\eccard stop < c:\\bat\\del_yes.rsp&quot;);


Any help is really appreciated.

Thanks.
~~fromkc
 
The first question I must ask is does it prompt you if you run it from a command prompt?

Example:
c:\winnt\system32\eicon\eccard stop < c:\bat\del_yes.rsp

Second is what are the available command line switches for eccard? You could try using a eccard stop /Y.

Don't know if this helps or not, but I don't know what eccard is.
 
jsaxon2,
Thanks for your reply, firstly :yes, when i run the eccard stop command it asks me for yes/no in the command prompt.
However, i have just discovered my answer in your suggestion
(duh!!)
that i could run the same thing: by eccard stop /yes
which solves my problem.

Thanks for your suggestion.

- eccard is just a third party exe to control a X.25 protocol card.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top