how can you make a file copy itself?
Printable View
how can you make a file copy itself?
u mean an exe-file?
Or like a virus - who knows.
a TXT file but it would be handly if i knew how to copy a .exe file
You mean like from the command prompt
copy c:\from\here.txt c:\to\there.txt
no i want a program to automatically copy itself a certain amount of times when ran is there anyway to do that?
I can think of no good reason why you'd want to do that. The solution, however, is simple if you think about it.
well vould you give me a little hint im new to C++
If you're new to C++, this shouldn't be a first project. Try learning the language before you do stupid things like this. The last thing we need are more poorly written viruses...er..self-replicating programs.
Quzah.
no its not for a virus is anyone going to help me?
Nope
> no i want a program to automatically copy itself a certain amount of times when ran
Sure sounds like it to me.
What could be the benefit of that, apart from filling up your disk with copies ?
> a TXT file but it would be handly if i knew how to copy a .exe file
A TXT file does not execute (unless M$ really screws up and makes them executable the same way they've gone with JPG files).
> no its not for a virus is anyone going to help me?
Not me.
Give us a good reason why a program would need to make copies of itself, and maybe someone will help you then.
well im trying to make a program that will make a copy of itself before destroying itself
It's not reliably possible in pure standard C++.