Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Executing An Exe From Within A Program!, Need help with my project
amitojduggal
post Feb 19 2006, 02:14 AM
Post #1


Member [Level 1]
****

Group: Members
Posts: 68
Joined: 30-July 05
Member No.: 10,043



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.
Go to the top of the page
 
+Quote Post
DeveloperX
post Feb 19 2006, 01:59 PM
Post #2


Advanced Member
*******

Group: Members
Posts: 130
Joined: 21-December 05
Member No.: 15,990



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!!!
Go to the top of the page
 
+Quote Post
michaelper22
post Feb 19 2006, 09:37 PM
Post #3


-=Hybrid Bus=-
*********

Group: Members
Posts: 742
Joined: 2-November 05
From: My hybrid bus (in NYC), a computer
Member No.: 13,709
Spam Patrol



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.
Go to the top of the page
 
+Quote Post
amitojduggal
post Feb 21 2006, 09:26 AM
Post #4


Member [Level 1]
****

Group: Members
Posts: 68
Joined: 30-July 05
Member No.: 10,043



People someone please tell me how to use that in C++,I am going insane making that program.
Somebody help!!!1
Go to the top of the page
 
+Quote Post
switch
post Feb 22 2006, 07:11 AM
Post #5


Premium Member
********

Group: Members
Posts: 178
Joined: 13-October 04
From: NSW, Australia
Member No.: 1,713



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!
Go to the top of the page
 
+Quote Post
osknockout
post Feb 27 2006, 02:00 AM
Post #6


Super Member
*********

Group: Members
Posts: 399
Joined: 14-November 04
From: Elysium
Member No.: 2,280



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
Go to the top of the page
 
+Quote Post
jibnet
post Jun 4 2006, 03:51 PM
Post #7


Member [Level 1]
****

Group: Members
Posts: 53
Joined: 4-June 06
Member No.: 24,718



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
Go to the top of the page
 
+Quote Post
iGuest
post Jul 9 2008, 12:54 PM
Post #8


Hail Caesar!
*********************

Group: Members
Posts: 5,876
Joined: 21-September 07
Member No.: 50,369



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
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Software Installation(5)
  2. Stop A Program Excecution(4)
  3. Program Flow(2)
  4. Timeouting Program(2)
  5. Crazy Looking C Program(19)
  6. C++(15)
  7. Run A Program From Another One(4)
  8. Program From Mekka 97 4k(2)
  9. Need Debugging Help For A Simple Program(3)
  10. Need Help With Kernel Compilation(1)
  11. Accessing Physical Memory(3)
  12. Need Help With C Program To Test If A Number Is Prime(12)
  13. My First C++ Program(6)
  14. Source Code For Paint Like Program Under Dos In C(2)
  15. Program Lang I Know(2)
  1. Centering The Text In A Simple C++ Program?(8)
  2. Buffer Overflow In Action Tutorial(0)
  3. C Or C++ Easy Programming Generator(6)
  4. A C++ Program Print Hello With Nothing Written In Main() Method(2)
  5. A Crazy Program In C(13)
  6. How To Run A Process Through Your Program (c#)(0)
  7. Any Program Ideas?!(5)
  8. If/else Demo Program Bug(4)