显示来自 Windows 批处理文件的弹出/消息框 [英] Show a popup/message box from a Windows batch file

查看:29
本文介绍了显示来自 Windows 批处理文件的弹出/消息框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法从批处理文件中显示消息框(类似于如何从 Linux 中的 bash 脚本使用 xmessage)?

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)?

推荐答案

我会制作一个非常简单的 VBScript 文件,并使用 CScript 调用它来解析命令行参数.

I would make a very simple VBScript file and call it using CScript to parse the command line parameters.

MessageBox.vbs 中保存的类似以下内容:

Something like the following saved in MessageBox.vbs:

Set objArgs = WScript.Arguments
messageText = objArgs(0)
MsgBox messageText

你会这样称呼:

cscript MessageBox.vbs "This will be shown in a popup."

MsgBox参考如果你有兴趣走这条路.

MsgBox reference if you are interested in going this route.

这篇关于显示来自 Windows 批处理文件的弹出/消息框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆