【问题标题】:how can i make more than 1 button appear in a popup box and can i make the buttons open programs我怎样才能让一个以上的按钮出现在弹出框中,我可以让按钮打开程序吗
【发布时间】:2014-01-03 01:16:51
【问题描述】:

我想在我的计算机启动时出现一个弹出框,其中有 3 个按钮,1 个启动 word,1 个启动 Firefox,1 个启动 steam。有没有办法在批处理文件中做到这一点?

我知道如何让一个弹出框批量出现:

@echo 关闭

msg * 这是消息所在的地方。

但这只会让一个按钮说好的。

【问题讨论】:

  • stackoverflow.com/questions/4356053/…。在发布之前做一些研究。
  • 我可以通过 powershell 完成。但不是来自 .cmd 或 .bat。我的 powershell IDE 中有一个带有 3 个按钮的表单模板,如果你问我会发布它。
  • knuckle-dragger 请你发布那个模板和我应该使用哪个版本的powershell。我假设是最新的(我认为是 3)

标签: batch-file


【解决方案1】:

您必须创建一个 VBS 脚本才能使用批处理脚本,但我不确定是否可以制作自定义按钮,因此您可以稍微调整一下对话框将具有三个按钮(是 [Word],否 [ FireFox],取消[Steam]):

@echo off
echo/WScript.echo MsgBox^(^"Start program^",vbYesNoCancel+vbInformation, ^"Start program^"^)>_temp.vbs
For /F "tokens=*" %%E in ('CScript //Nologo _temp.vbs') Do (Set "res=%%E")
::YES
if %res% == 6 (
::Here is the path to Microsoft Word
)
::NO
if %res% == 7 (
::Here is the path to FireFox
)
::CANCEL
if %res% == 2 (
::Here is the path to Steam
)
del _temp.vbs

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-11-12
    • 2017-05-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多