First please use the code tags available when creating post in format options. As for the question I do not understand, can you remove the unnecessary code which just makes the question more confusing & next get to the point & tell us the question directly without creating massive chunks of irrelevant information.
However I do understand the EDIT: question. It is possible to incorporate 2 executables - in fact softwares similar to it exist called "file binders" these are however mainly used in malware to infect PCs via binding a malware executable to a legitimate file.
To get a deeper understanding of how "file binders" work I would advise you to read about PE file infection which requires the audience to have expert level knowledge on windows API & security in general. File binders are not a single file such as a single process or single handles but rather 2 file's machine code stored in one file with a CALL operation on each files entry point.
Therefore it is not exactly a single executable with 2 files codes because computer does not know vital information such as what file's code to run.
I have for example the file program.txt. To compile it for a microprcessor i must open cmd prompt, get to the directory the file is and write A8051.exe program program program, after that i also do Xlink.exe -c8051 program. I get as output an AOUT.A03 wich i rename to program.hex.
This is so the whole procedure i have to do to get my hex file for the microprocessor.
I want to create myself an executable that does all this procedure asking me the filename only once.
The program will get the filename, pass is as parameter to the other executables i mentioned and automatically creates my file, simple as that.
Made a working bat file for my purpose however there's only one big problem.
This program will also show errors in the code you wrote in the txt file if there are any, if you have a considerable amounts of errors it will scroll down but i'm unable to scroll back up to the upper part of the error list, it seems to forget lines after a certain numbers in order to be able to add new ones, how can i increase the number of lines a bat file can use?
Open up a cmd window, right-click the title bar, click "Properties", go to "Layout", and increase the height of the screen buffer size.
If you need more than 32766 lines, you may want to consider redirecting the output to a file instead of printing them to the screen.
Something like myprog.exe command line arguments > myfile.txt 2>&1
(or, if you want to append to myfile.txt instead of replacing it, change the first > to a >>).