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

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

问题描述

是否有一种方法来显示来自批处理文件的消息框(类似于 xmessage 可以从Linux中的bash脚本中使用)?

解决方案

我将创建一个非常简单的VBScript文件,并使用CScript来解析命令行参数。



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

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

您会这样调用:

  cscript MessageBox.vbs这将显示在弹出窗口中。 

MsgBox >

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

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:

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

Which you would call like:

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

MsgBox reference if you are interested in going this route.

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

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