Hi All,
I have an application and made it as embedded exe.That must be present in application folder to run it.
if it is not present i have to write the embeded exe file to the startup path and make it run
any suggestions
cheers
[WINFORM] how to Write an executable exe file to the disk?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Jean PaulRank #32 · 38.5K reputationPosted Jan 19, 2011, 2:42 AM EST
// You have to find the correct resource name for EmbedExe.regedt32.exe
// Use Assembly.GetExecutingAssembly().GetManifestResourceNames() to find it
Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("EmbedExe.regedt32.exe");
FileStream fileStream = new FileStream("new.exe", FileMode.CreateNew);
for (int i = 0; i < stream.Length; i++)
fileStream.WriteByte((byte)stream.ReadByte());
fileStream.Close();
// The above code retrieves the bytes and write to file new.exe in application bin folder
Regards,
Jean Paul
* pls mark as answer if helped