有没有一种方法可以从批处理文件中显示消息框(类似于Linux中可以从bash脚本中使用xmessage
的方式)?
有没有一种方法可以从批处理文件中显示消息框(类似于Linux中可以从bash脚本中使用xmessage
的方式)?
msg * /server:127.0.0.1 在此输入您的消息
where msg
返回C:\Windows\System32\msg.exe
。我想你在想net send
。 - Jesan Fafon更好的选择
set my_message=Hello world
&& start cmd /c "@echo off & mode con cols=15 lines=2 & echo %my_message% & pause>nul"
描述:
lines=
行数+1
cols=
消息中字符的数量+3(但最小必须为15
)
cols
版本:set my_message=Hello world
&& (echo %my_message%>EMPTY_FILE123 && FOR %? IN (EMPTY_FILE123 ) DO SET strlength=%~z? && del EMPTY_FILE123 ) && start cmd /c "@echo off && mode con lines=2 cols=%strlength% && echo %my_message% && pause>nul"
start cmd /c "@echo off & mode con cols=18 lines=2 & echo My Popup Message & pause>nul"
),而你的则不行。它会输出消息,但无法设置窗口大小,在我的Windows 7上返回“无法将屏幕设置为指定的行数和列数。” - cdlvcdlv它只需要在虚拟机内弹出,因此从技术上讲,应该有一些代码像这样:
if %machine_type% == virtual_machine then
echo message box code
else
continue normal installation code