Batch File to Make Message Box
Intro: Batch File to Make Message Box
How To Make A Message Box With A Batch File.
Key:
0 =OK button only
1 =OK and Cancel buttons
2 =Abort, Retry, and Ignore buttons
3 =Yes, No, and Cancel buttons
4 =Yes and No buttons
5 =Retry and Cancel buttons
16 =Critical Message icon3
2 =Warning Query icon
48 = Warning Message icon
64 =Information Message icon
STEP 1: The Code
@echo off
echo x=msgbox("Your Text Here" ,0, "Your Title Here") >> msgbox.vbs
start msgbox.vbs
^Sorry For MIstake!!!
Replace 0 with your number.
STEP 2: Save As Msg.bat
DONE!
10 Comments
safouanbenzeyan 3 years ago
Tigerboi 3 years ago
My main question is this: How do I display the red exclamation mark warning shield icon in the dialogue box (or any red exclamation mark) as well as being able to specify whether you want Yes/No, Ok/cancel, etc as it looks from what you've written above like you have to have one or the other, which I'm surely isn't the case. Also, the number you specified for "Warning query icon" doesn't work...
Please could you supply a few examples of working batch file script that demonstrates a few of the possibilities, and how to apply actions for clicking on Yes/No, Ok/cancel, etc?
swaminathan.vp 3 years ago
1. Can this be not done without the vbs file? The vbs file stores the echo command each time when the batch file is run. This adds on the popup each time I run the batch file.
2. How can I make an EXE run after I click on the ok button from the message box?
I tried using &&. but did not work.
swaminathan.vp 3 years ago
I have the x=msgbox("Your Text Here" ,0, "Your Title Here") in the msgbox.vbs instead of having in the batch file.
In the batch file, I just call or start the vbs file.
This way I always have one popup message box.
Thanks!
Let me look for 2 now.
swaminathan.vp 3 years ago
For example,
call msgbox.vbs && call "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
This displays the message that I want and only when clicked on Ok, Chrome opens.
Thanks for the help! :)
ḞrḁnḉiṡC56 6 years ago
This is not the answer that i've been looking for it create a vbs file lol
bryngriffiths2013 3 years ago
Juju_kek 4 years ago
Markuz123 6 years ago
How do you make it do something based on the button pressed
Markuz123 6 years ago
There are two of number 2 in the options