Well, might as well answer the question for the unwitting fool.
The only frickin possible way for a program to run entirely in and from memory is if you have a RAM disk. RAM disks are virtual "harddrives" which take a chunk of your REAL memory for use. In that case, just copy the file from your RAM disk to your hard disk.
Since this is NOT your case - cause RAM disks haven't been used really since the reign of DOS - you just don't know what you're talking about. In the EXTREMELY UNLIKELY possibility that you can even do that, there is no way to save the file to disk unless that program gives you the option to do this. Even when a program is run from the disk - the entire thing isn't stored into memory. It's not about a file being put in memory, it's about various modules of code within that file being loaded and unloaded.