Does anyone know the code to open another program in dos?
Does anyone know the code to open another program in dos?
Call system() and pass the name (including the path) of your other program, eg:
system ("c:\\testprogram.exe");
Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.
- Mike McShaffry
System not always a good option :
There a great post here on doing this very thing :
FAQ
I had a feeling it wasn't. To tell the truth I've never really opened a program from a program system() just popped into my head. Maybe I shouldn't have answered...
Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.
- Mike McShaffry
it not that bad in some cases, anyways i forgot to include
the usual dumb remark, so here it goes.
Did you really want to know how to open a program through
dos, or did you mean a command prompt, because they
are 2 different things?
I think he means from inside another program.Does anyone know the code to open another program in dos?
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
yea i know that i was just being a a$$ lol
id already answered his question anyways.
I meant if i make a index program like if you input 1 then open this *.exe
what you should do is have a file
where the user can add the path to
any programs he wants then simply
read them in display them
let the user pick which one to run
then you can run it
the best way is to not rely on outside programs unless you have a way to verify that they are/are doing what you want/need them to be doing...
for examle, system(...) just basically sends a request to the OS. it's the same as typing directly on the command line. but that becomes a problem when something's not right. what happens when somebody moves notepad, or worse, replaces it with a malicious bit of code?
ILoveVectors was right about the difference between DOS and the command prompt, and it is a very valid point--don't get them confused. DOS is an old operating system, that is no longer included with newer windows operating systems.
for example, in windows 95, you can use DOS. in Windows XP, there is no DOS to use. when you bring up a command prompt and type in 'notepad.exe', it's pretty much the same as going through the start menu and clicking on notepad...
Join is in our Unofficial Cprog IRC channel
Server: irc.phoenixradio.org
Channel: #Tech
Team Cprog Folding@Home: Team #43476
Download it Here
Detailed Stats Here
More Detailed Stats
52 Members so far, are YOU a member?
Current team score: 1223226 (ranked 374 of 45152)
The CBoard team is doing better than 99.16% of the other teams
Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)
Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT