How would I go about telling a program to open itself twice??
As in... you run Example.exe, and in the code it tells it self to open Example.exe AGAIN from where ever it is currently located on the system.
Is this possible? Me is a C++ noob.
Thanks.
This is a discussion on how to open program twice within the C++ Programming forums, part of the General Programming Boards category; How would I go about telling a program to open itself twice?? As in... you run Example.exe, and in the ...
How would I go about telling a program to open itself twice??
As in... you run Example.exe, and in the code it tells it self to open Example.exe AGAIN from where ever it is currently located on the system.
Is this possible? Me is a C++ noob.
Thanks.
Shellexecute msdn ,
can you further explain this? Like I said.. I am very much a noob![]()
If you are very much a noob, I question whether what you requested is really what you want to accomplish. Why would you want to do this?
Definition: Politics -- Latin, from
poly meaning many and
tics meaning blood sucking parasites
-- Tom Smothers
compile this into "test.exe":Code:#include <iostream> #include <cstdlib> int main() { std::cout<<"Ha"<<std::flush; system("./test.exe"); return 0; }![]()
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
I don't see any reason to do that except for malicious purposes...
there are plenty of reasons to have a program spawn of a copy of itself, but it's better to use threads, which aren't standard in C++
most programs you use have more than one process running at any given time... how do you think windows could keep track of the mouse and display teh time at the same time?
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
Yeah but the way he is talkuing about is it executes and then that one executes another one which will execute another one again and it will just keep spawning