Hello,
I have a little unit that does that, it is called URUNPE.pas
Here it is with a test file, go and download them:
http://pages.videotron.com/aminer/RunPE/URUNPE.PAShttp://pages.videotron.com/aminer/RunPE/test.pashere is how you have to execute it:
runexe('c:\windows\system32\cmd.exe -9 1.pdf',urunpe.TByteArray(mem.memory),processhandle)
here you have to pass cmd.exe as a parameter with the other parameters,
here in this example i am passing -9 and 1.pdf to pigz.exe , after that
you have to pass also mem.memory that is a TMemoryStream that contains
your executable, and after that you pass a processhandle that is just a THandle
variable.
after that you have to call: waitforsingleobject(processhandle,infinite);
if you want to wait on the executable to be executed ..
and don't forget to close the handle with:
closehandle(processhandle);
Amine Moulay Ramdane.