• 0

Converting a .bat to a .exe


Question

Hi Guys,

How do I convert a .bat (batch file) to a exe, so people can't edit it and screw it up? I tried the bat2exec program, but that makes it a .com and it turns out really messed up. Anyone have any ideas?

Thanks,

Jason :)

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Just use the system(...) command to make a program that does it. Like this:

#include <stdio.h>

int main(void)
{
       printf("This will make a directory then remove it.\n");
       system("mkdir //dir//");
       system("rm //dir//");
       
       return 0;
}

And there you go. :)

Link to comment
Share on other sites

  • 0
How about changing the privelages for the file by adminning it.

System(...) does work, but its a really crude hack.

Or be really clever and create a SFX winrar archive that extracts the file on it's own, runs it, and then the file deletes itself.

You can lock the archive.

Link to comment
Share on other sites

  • 0

There once was a tool to do just what you wanted.. dont know if it works in newer OS like 2k/xp anymore.. And it is a little limeted.. but....

Search google for "bat2exe", you can find several sites with info about versions of it :unsure:

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.