.netvb.netcodedomcsharpcodeprovidersystem-codedom-compiler

Create an .EXE from an .EXE


So what I want to do is create an executable in a program in vb. What I mean by this is that there is a program that can output a .EXE. What I try to do is to create a program that can output a smaller program that runs predefined commands.

All I know is that it is somehow possible with a STUB. That you open the STUB and add extra code to it and save it again as an .EXE.


Solution

  • You can use compiler services to create EXE at run time.

    CSharpCodeProvider : Provides access to instances of the C# code generator and code compiler.

    Dynamic Creation of Assemblies/Apps

    System.CodeDom.Compiler