Is there a way to display a message box from a batch file (similar to how xmessage
can be used from bash-scripts in Linux)?
相关问题
- Inheritance impossible in Windows Runtime Componen
- how to get running process information in java?
- Is TWebBrowser dependant on IE version?
- How can I have a python script safely exit itself?
- I want to trace logs using a Macro multi parameter
相关文章
- 如何让cmd.exe 执行 UNICODE 文本格式的批处理?
- 怎么把Windows开机按钮通过修改注册表指向我自己的程序
- Warning : HTML 1300 Navigation occured?
- Bundling the Windows Mono runtime with an applicat
- Windows 8.1 How to fix this obsolete code?
- Compile and build with single command line Java (L
- CosmosDB emulator can't start since port is al
- How to print to stdout from Python script with .py
In order to do this, you need to have a small program that displays a messagebox and run that from your batch file.
You could open a console window that displays a prompt though, but getting a GUI message box using cmd.exe and friends only is not possible, AFAIK.
msg * /server:127.0.0.1 Type your message here
This will pop-up another Command Prompt window:
A better option
set my_message=Hello world
&& start cmd /c "@echo off & mode con cols=15 lines=2 & echo %my_message% & pause>nul"
Description:
lines=
amount of lines,plus 1cols=
amount of characters in the message, plus 3 (However, minimum must be15
)Auto-calculated
cols
version:set my_message=Hello world
&& (echo %my_message%>EMPTY_FILE123 && FOR %? IN (EMPTY_FILE123 ) DO SET strlength=%~z? && del EMPTY_FILE123 ) && start cmd /c "@echo off && mode con lines=2 cols=%strlength% && echo %my_message% && pause>nul"
This message waits forever until OK is clicked (it lasts only one minute by default) and works fine in Windows 8.1
I would make a very simple VBScript file and call it using CScript to parse the command line parameters.
Something like the following saved in
MessageBox.vbs
:Which you would call like:
MsgBox
reference if you are interested in going this route.