|
Answer» (If you never seen me, im a new user and i just registered.)
Well, im a pro on batch files but im creating in Advanced BAT to EXE Converter 2.92 a Setup. But the problem is that with a example of:
cd %userprofile%\Desktop echo HELLO WORLD! >> example.txt
How i MAKE a exe file with something like that? Please help!There is no true way to make a batch file into an EXE. All the Bat to EXE converters do is create a wrapper around the batch file. When the exe wrapper is executed it extracts the batch file to a temporary directory and executes the batch file.I used Batch to EXE before to wrap batches into EXE files when the batch files had credentials in them to escalate privileges, but other than that they are pretty worthless. Also being wrapped as an EXE doesnt mean that someone dedicated enough wouldnt figure out how to view the passwords etc.If the OP is an expert in batch, it should not be hard to use a general purpose language. Currently he favorite is C++ for most people. One can make good EXE files with C++ that can make use of the Microsoft .NET library.
Pragmatically anything you do in batch can be done nicely in C++.I PRESUME this setup application is being written as a learning exercise because if you are writing a setup program for an application that you are planning on distributing, there are already tonnes of both free and commercial installers for Windows that you can use such as INSTALLSHIELD (commercial) or NSIS (open source).
Quote from: Geek-9pm on December 29, 2014, 10:54:05 AM If the OP is an expert in batch, it should not be hard to use a general purpose language. Currently he favorite is C++ for most people. One can make good EXE files with C++ that can make use of the Microsoft .NET library.
Pragmatically anything you do in batch can be done nicely in C++.
C++ has a use but is only really worthwhile in much lower level programs, there are a lot of much more suitable languages for most tasks. It is certainly not the "favourite for most people".
While I personally don't use Batch, for this use (a setup program), a shell scripting language is surely the most suitable since its main job is GOING to likely be moving files around on disk, Trying to use C++ for this would be a right pain, you would end up doing a lot more work for exactly the same output, not to mention all the other issues that crop up with C and C++.
|