Sunday, August 23, 2015

How to Convert Bat To Exe with 7 Steps? (with images)

Good day!
With this post i am going to show you how to create and compile a simple batch file with Batch Compiler. We are going to convert bat to exe which has more security and stability. You can add your meta data and resources to your program. Considering this is your first batch script, I will walk you through the steps :)

Step 01 :

First, You need to download Batch Compiler, For those who do not know about this software, Batch Compiler is an Integrated Development Environment. That means it has all the tools that you need to develop a batch program. You can download it here And home page here

Step 02 :

Okay. Now extract the downloaded zip archive and install Batch Compiler running setup.exe


 
Step 03 :

Now, Run Batch Compiler. You will get the main interface. As you can see it has a very simple, yet powerful workspace. Big white worksheet is used to write the code. Standard toolbar is consisted with basic operation icons. I'm not going to discuss all features in this article. Read the documentation to get a clear idea.


Step 04 :

Let's start coding. As this is your first batch program we are going to do a 'Hello World'. A simple batch file to show the text 'Hello World!' in command prompt. Here is the code--

I will walk you through line by line,

line #1 @Echo Off
Command prompt usually designed to show the processing commands and their status to user. We avoid showing them using '@Echo Off'.

line #2 Echo.
This command prints a blank line in command prompt.

line #3 Echo Hello World!
This prints the text "Hello World!" on command prompt. Any text followed be Echo command will be printed on command prompt.

line #4 Pause>Nul
This one pauses the command prompt for us, that we can read the text we printed before it closes. Additionally, ">Nul" command avoids command prompt from showing "Press any key to continue" message. We could use just "Pause" but then it will show above message  :)

line #5 Exit
It is sort of uncompleted, as i wanted to show you one of the cool features of Batch Compiler. That one is called Intellisense. It will guess commands as you type on worlspace ;)
Okay, back to work! Obviously "Exit" code exits the command prompt.


Step 05 :  

Its time to check our  code. Just click on 'Run' button in tool bar. This will launch the Debugger, which will check our code line by line and shows us if any error. This is a unique feature if Batch Compiler. After the debugger, if the code is errors free, Batch Compiler will run the program. Remember, this runs a compiled exe of the code. Not the raw batch script.




Step 06 :

Let's Compile! look at the 'compile' button in toolbar. This will launch the Compiler. Change Exe name, Choose an icon, set version info, copyright info and add resources, change visibility and privileges and Compile!




Step 07 :

Enjoy your Exe!

No comments:

Post a Comment