The command prompt, or CMD, has been a staple in the world of computing for decades, providing a text-based interface for users to interact with their computers. However, the default CMD interface lacks graphical elements, making it challenging to create visually appealing applications. Enter Button Function, a batch plugin designed to bring a burst of color and interactivity to the command prompt by allowing users to create colorful buttons with a simple syntax. You can download the Button function from our GitHub.
Related Video
Getting Started with Button Function
Button Function helps in adding a GUI button to your batch program. For this, It uses the below plugins:
- Box Function by Kvc
- Batbox by @darkbatcher
- GetInput by Aacini
- Getlen Function by Kvc
- QuickEdit by @anic17
It displays a button on the console at a specified (X, Y) coordinate. After printing, it returns the area of the button and the inverted color, which can be used afterward with the GetInput.exe plugin. The syntax for creating buttons using the Button Function is straightforward and follows the pattern:
call Button [Item 1] [Item 2] [Item 3] ... X _Var_Box _Var_Hover _Var_Code
NOTE: In this new version of Button function, an additional parameter is added at the end of the function call. To make it easier for you to handle and use the library function easily in your projects.
-Kvc
Where:
- [Item]: is short for this combination: [X] [Y] [color] “[Button text]”
- [X]: X coordinate of the top-left corner of the button
- [Y]: Y coordinate of the top-left corner of the button
- X: Here, the single ‘X’ (Must be the fourth last element) indicates the loop sequence breaker for the function. After the ‘X’ you need to provide three variables, which will return the corresponding values for GetInput and BatBox.
- _Var_Box: The third last parameter is the name of the variable to save the coordinates of all the buttons on the console (Support for GetInput).
- _Var_Hover: The second last parameter is the variable’s name to save the mouse hover color for each button (Support for GetInput).
- _Var_Code: The last parameter is the name of the variable to save the BatBox argument string.
Interactivity with Button Function
While the command prompt is primarily a text-based interface, the Button Function introduces a level of interactivity by allowing users to create clickable buttons. When a button is clicked, the corresponding action can be triggered using additional batch scripts or commands.

In this example, 16 Buttons are created and what button is clicked shows on the title bar of the window. The corresponding batch script listens for user input and executes different actions based on the clicked button.
Conclusion
Button Function opens up new possibilities for enhancing the visual appeal and interactivity of the command prompt. By providing a simple syntax to create colorful buttons, this batch plugin allows users to design more engaging and user-friendly applications within the command prompt environment.
Whether you are a batch scripting enthusiast or a developer looking to experiment with command line interfaces, Button Function is a valuable tool to add to your toolkit. Explore the creative potential of the command prompt and make your applications stand out with the vibrant and interactive buttons created using the Button Function. For more articles like these visit our site at Batch-man, you can also join our Discord and YouTube community.
