How could I make a program (win32) copy itself into a given directery, even if I don't know where the program is?
Printable View
How could I make a program (win32) copy itself into a given directery, even if I don't know where the program is?
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.