Jump to content
xisto Community
Sign in to follow this  
amitojduggal

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

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

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

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

Share this post


Link to post
Share on other sites

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.exe2) MS-DOS understands local commands~I'm working on an actual Win-DOS system here, should work on an XP. :lol:

Share this post


Link to post
Share on other sites

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.exeit 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 followssystem("c:\\fort\\fort.exe"); Thanxfor more info .. mail me at jibranbhat@gmail.com

Share this post


Link to post
Share on other sites

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:fortfort.Exe");?

 

-reply by ashwini

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.