标题: [系统相关] 批处理如何实现 msgbox(是或否),选是,或选否,执行不同的代码? [打印本页]
作者: toomee 时间: 2022-7-30 10:32 标题: 批处理如何实现 msgbox(是或否),选是,或选否,执行不同的代码?
mshta vbscript:msgbox(“该干活了,伙计!”,64,”提示”)(window.close)
请教
作者: idwma 时间: 2022-7-30 14:42
- for /f %%i in ('mshta "vbscript:CreateObject("Scripting.FileSystemObject").GetStandardStream(1).WriteLine(msgbox("该干活了,伙计!",68,"提示"))(window.close)"') do echo %%i
复制代码
作者: Batcher 时间: 2023-9-28 14:22
请参考Q-04把bat文件保存为ANSI编码:
https://mp.weixin.qq.com/s/Koje4FufWxWBs7ioDy_LJA- @echo off
- set "StrContent=【警告】连续丢包超过10个!是否继续?"
- set "StrTitle=系统管理员提醒"
- for /f %%i in ('mshta "vbscript:CreateObject("Scripting.FileSystemObject").GetStandardStream(1).WriteLine(MsgBox("%StrContent%",68,"%StrTitle%"))(Window.Close)"') do (
- set "ButtonValue=%%i"
- )
- if "%ButtonValue%" equ "6" (
- echo 用户点击按钮:确定
- ) else if "%ButtonValue%" equ "7" (
- echo 用户点击按钮:取消
- )
- pause
复制代码
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |