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
Few more ways.
1) The geekiest and hackiest - it uses the IEXPRESS to create small exe that will create a pop-up with a single button (it can create two more types of pop-up messages). Works on EVERY windows from XP and above:
2) Using
MSHTA
. Also works on every windows machine from XP and above (despite the OP do not want "external" languages the JavaScript here is minimized). Should be saved as.bat
:or in one line:
or
or
3) Here's parameterized
.bat/jscript
hybrid (should be saved asbat
). It again uses JavaScript despite the OP request but as it is a bat it can be called as a bat file without worries. It uses POPUP which allows a little bit more control than the more popular MSGBOX. It uses WSH, but not MSHTA like in the example above.4) and one
jscript.net/.bat
hybrid (should be saved as.bat
) .This time it uses.NET
and compiles a small.exe
file that could be deleted:5) and at the end one single call to powershell that creates a pop-up (can be called from command line or from batch if powershell is installed):
6) And the dbenham's approach seen here
7) For a system tray notifications you can try this:
Following on @Fowl's answer, you can improve it with a timeout to only appear for 10 seconds using the following:
See here for more details.
Msg * "insert your message here"
works fine, just save as a .bat file in notepad or make sure the format is set to "all files"
This application can do that, if you convert (wrap) your batch files into executable files.
Simple Messagebox
Error Messagebox
Cancel Try Again Messagebox
4) "Never ask me again" Messagebox
You can invoke dll function from user32.dll i think Something like
Typing it from my Phone, don't judge me... otherwise i would link the extra flags.
I use a utility named msgbox.exe from here: http://www.paulsadowski.com/WSH/cmdprogs.htm