How could I make a program (win32) copy itself into a given directery, even if I don't know where the program is?
How could I make a program (win32) copy itself into a given directery, even if I don't know where the program is?
"If you tell the truth, you don't have to remember anything"
-Mark Twain
A running program can always find out where it "is" by calling the GetModuleFileName() API function and passing NULL as the module handle.
What may be a problem is copying an active program, I don't recall ever trying this, it may be okay. Normally I would use an installer for this kind of thing.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.