Reputation: 25
I have a bat to execute all files in a folder every 15 seconds. I need to make it .exe to run it as a hidden application. I have converted it to .exe with bat to exe converter and other programs, and I see that in all of them, when I execute the .exe, for example, Load.exe, automatically start a cmd.exe at the same time. If I kill Load.exe it still continues to run, until I kill cmd.exe.
So, can I make an .exe from a .bat without depending on a cmd.exe?
Upvotes: 0
Views: 2756
Reputation: 3591
I don't know if it depends on CMD or not (probably it doesn't), but you can use C++ function system to execute each line of your .bat file.
Do it something like :
#include <stdlib.h>
int main()
{
system("<batch command goes here>");
return 0;
}
Simultaneously, you can add each line of .bat file to system function and execute it as a CPP/C program.
Upvotes: 0