![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Jan 2006
Location: Texas
Posts: 36
Rep Power: 0
![]() |
Program keeps on closing
Yes i know i kind of asked this before...
I have many files in a folder, and i want a "program.exe" in the main page, along with a read-me and an uninstall file. So i made a program to do it: #include <iostream>
using namespace std;
int main()
{
system("start prgm\ddwwn.exe");
}It works fine, but when try to open another exe file through ddwwn.exe, it just closes... i know i can fix this problem by puting a system("pause"); tag in the program.exe file, but i dont want it to just stay there. Is there another option? Sorry for repeating this question.... |
|
|
|
|
|
#2 | |
|
Professional Programmer
|
Can I ask what you are trying to do with all these questions? Using installers, hide files, run programs and websites? It reminds me of a "hack" I was trying to create a few years ago when I was bored, living in the country(I didn't have internet, I didn't send it to anyone, just playing around with myself(lol) while I had no life at all).
If you are attempting to create a "virus/hack", Please at least use your own code and not installers, there is nothing more lame than using another persons program to help you with a malicious file. I would know. If you aren't using all this stuff for what i'm thinking though, forget I said anything. I am at a point in my winsock server/client where I am attempting to create my own commands and running websites is one of them so I can't really say anything to you about that either way. As for your question, Threads or a loop would work I am not too sure I understand what you mean by run programs through "program.exe" though.
__________________
▄▄▄▄ Quote:
Due to incorrect calculations during the middle ages, our calendar actually begins a few years after Jesus' birth. Thus the real 6/6/6 happened a few years back. The world already ended and you missed it. Download Code::Blocks now! ▄▄▄▄ |
|
|
|
|
|
|
#3 |
|
Programmer
Join Date: Jan 2006
Location: Texas
Posts: 36
Rep Power: 0
![]() |
no no no! im sorry you completely mis understood. im not making a hack. im a student making a science fair project. ddwwn stands for "differfentiating dengue with west nile".
and what i meant by saying running a exe through ddwwn.exe was i was saying system("example.exe") in ddwwn.exe. sorry for the confusion i should really elaborate more. |
|
|
|
|
|
#4 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
I don't understand what the problem is? You don't have access to ddwwn unless you have the source code or can pass it paramaters.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
#5 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
I believe you've asked this question before, and been answered. If you wish to use the system command repeatedly, you need to put it in a loop. The loop should ask for the name of the next program you wish to run (or get it from a list). This keeps up until you enter a token to terminate the program (or exhaust the list). It isn't necessary to use the system call; there are other ways to execute programs that my give you more feedback. As far as programs closing when they're through, that's what they're supposed to do. If you want termination to be contingent upon user input, then you have to ask for user input. This issue has been discussed ad nauseum on this forum and every other forum from Fink, Texas to Bangalore. I would suggest that you write some serious code and return for help. Four lines of junk written while ignoring your previous answers and advice isn't hacking it.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#6 |
|
Programmer
Join Date: Jan 2006
Location: Texas
Posts: 36
Rep Power: 0
![]() |
i do have the source code because i made it
|
|
|
|
|
|
#7 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
So do you want us to look at it and make suggestions, or is it a secret, or is it just fine and the sample above is what you need to work on?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|