Nov 22, 2009

Executing An Exe From Within A Program! - Need help with my project

free web hosting
Open Discussion > MODERATED AREA > Computers > Programming Languages > C/C++ Programming

Executing An Exe From Within A Program! - Need help with my project

amitojduggal
Hello everyone,
I need help, I need to know which function , or a user defined one should i use to call a exe from within a program, Like i use switch cases , it certain condition is encountered the exe should gets executed, that is what i want to do, I am making an operating system for my projects at university, I need that thing. So somebody please help me, This is the forum that lets me find all my solutions. I have a 100% problem solution rate here, everyone has helped me alot, Waiting for some one to post a reply.

Comment/Reply (w/o sign-up)

DeveloperX
I use such WinAPI function:

CODE


WinAPI::shellExecute("c:\\program.exe", 'parameters');



It function run some program within your own program!

I found this or other cooolest functions in MSDN!!!

Comment/Reply (w/o sign-up)

michaelper22
In .Net programming, bring in the System.Diagnostics namespace (don't know how to do this in C++, only VB.Net), and call Process.Start("C:\program.exe"). You can find additional parameters in the Object Browser.

Comment/Reply (w/o sign-up)

amitojduggal
People someone please tell me how to use that in C++,I am going insane making that program.
Somebody help!!!1

Comment/Reply (w/o sign-up)

switch
here's a really quick inefficient way to do it if you're absolutely desperate (and using windows):

CODE
system("c:\myProgram.exe");


system just pops open a command prompt and runs the bits in the quotation marks.
good luck!

Comment/Reply (w/o sign-up)

osknockout
Add #include <cstdlib> to the beginning of the file for switch's technique.

-And if I'm correct, you don't really have to type system("c:\myProgram.exe"),
you can just type system("myProgram")
1) because myProgram is assumed to be myProgram.exe
2) MS-DOS understands local commands

~I'm working on an actual Win-DOS system here, should work on an XP. biggrin.gif

Comment/Reply (w/o sign-up)

jibnet
When you run the system(FILENAME) to run another executable from within a program. This should be kept in mind while specifying the path for the FILE.
if the path is c:\fort\fort.exe
it should be entered as "c:\\fort\\fort.exe";
to enter a '\' character in a string '\' should be entered twice..
therefore the function should be called as follows

system("c:\\fort\\fort.exe");




Thanx
for more info .. mail me at jibranbhat@gmail.com

Comment/Reply (w/o sign-up)

iGuest-ashwini
How to pass the parameters to system( \\\"some.exe\\\")?
Executing An Exe From Within A Program!

DThanks. This method helped me a lot , anybody know how to pass parameters in system("c:\\fort\\fort.Exe");?

-reply by ashwini

Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)


Searching Video's for executing, exe, program, project
See Also,
advertisement


Executing An Exe From Within A Program! - Need help with my project

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com