jasonhilton Posted October 5, 2004 Share Posted October 5, 2004 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 More sharing options...
0 John Veteran Posted October 5, 2004 Veteran Share Posted October 5, 2004 You can't, they're different things. EXEs are executable code and batch files just contain lists of commands, no real code. Link to comment Share on other sites More sharing options...
0 Veiva Posted October 5, 2004 Share Posted October 5, 2004 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 More sharing options...
0 neowin_hipster Posted October 5, 2004 Share Posted October 5, 2004 so people can't edit it and screw it up? How about changing the privelages for the file by adminning it. System(...) does work, but its a really crude hack. Link to comment Share on other sites More sharing options...
0 Mordkanin Posted October 5, 2004 Share Posted October 5, 2004 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 More sharing options...
0 bilemke Posted October 6, 2004 Share Posted October 6, 2004 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 More sharing options...
0 OnlyMe Posted October 6, 2004 Share Posted October 6, 2004 AutoIt is a script compiler that can do most of the things that you can do in a batch file. It is fairly simple to use. You can check it out here (http://www.hiddensoft.com/AutoIt/) and check it out. I have used this myself to replace many of the things that I used to use batch files for. Link to comment Share on other sites More sharing options...
Question
jasonhilton
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