批处理文件中 msg * 命令的高级用法?

发布于 2024-10-06 05:29:57 字数 552 浏览 0 评论 0原文

编辑:对于这个问题,我已经开始悬赏 50 美元给谁给出最好的答案!

嗨,我想知道是否有一种方法可以让批处理文件使用 msg * "hi" 命令以及除默认情况下的其他选择(取消和确定)之外的其他选择,我的意思是向弹出消息添加自定义按钮,例如“下一步”按钮带您到另一条带有对话框或类似内容的弹出消息。总而言之,有没有办法编辑 msg * "text gets here" 命令的结果?

这就是出现的情况...

alt text

这就是我想要的:

alt text

但是,我也想知道是否可以更改弹出消息的标题及其大小或位置。我知道这开始听起来像是批处理文件中基于 gui 的弹出窗口,但我只是想知道它是否有必要(请记住,我只想使用批处理/shell)。任何信息或想法都会很有帮助!谢谢!

EDIT: I have started a bounty of 50 on this question to who ever gives the best answer!

Hi i was wondering if there was a way for a batch file to make a pop up appear using the msg * "hi" command along with other selections besides the ones that are there by default (cancel and ok) by this, i mean add custom buttons to the pop up message such as a "next" button that would bring you to another pop up message with dialog on it or something along those lines. In summary , is there a way to edit the results of the msg * "text goes here" command?

This is what comes up...

alt text

And this is kind of what i want:

alt text

However , i also would like to know if its possible to change the title of the pop up message and the size or position of it. I know that this is starting to sound like a gui based popup in a batch file but im just wondering if its possible by any means neccessary (Keep in mind that i only want to use batch/shell). Any information or ideas would really help! Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

罪歌 2024-10-13 05:29:57

首先,我不知道 msg.exe 的一些其他未记录的开关,您可以使用它们以您想要的形式创建消息。因为您询问了任何信息或想法,我决定写下我的答案。

您如何看待 Dependency Walker 程序 msg.exe 内部使用的情况来自 的函数 WinStationSendMessageWWinStationEnumerateWWinStationQueryInformationWWinStationOpenServerWWinStationFreeMemory winsta.dll 。函数 WinStationQueryInformationW 已记录,所有其他函数不是。尽管如此,人们可以相对确定这些函数与记录的函数相同 RpcWinStationSendMessage中记录的其他 RpcWinStationXXX 函数终端服务终端服务器运行时接口。我个人认为没有必要使用未记录的函数,因为其他已记录的函数 WTSSendMessageWTSEnumerateSessions (请参阅远程桌面服务 API)可以执行以下操作相同的。

两个函数 WTSSendMessageRpcWinStationSendMessage 具有参数 pTitleStyle(例如,可以是 MB_YESNOCANCEL),以及 < code>pResponse (您也可能对此感兴趣)。因此,我建议您或您大学的人自己编写您需要的小实用程序。您可以使用记录的 WTSSendMessageWTSEnumerateSessions 实现中的函数。

如果您要询问 serverfault.comsuperuser.com< /a> 可能有人会推荐您一个可以使用的现有实用程序。

First of all I don't know some additional undocumented switches of msg.exe which you can use to create the message in the form which you want. Because you asked about any information or ideas I decide do to write my answer.

How you can see with respect of Dependency Walker the program msg.exe use internally functions WinStationSendMessageW, WinStationEnumerateW, WinStationQueryInformationW, WinStationOpenServerW, WinStationFreeMemory from the winsta.dll . The function WinStationQueryInformationW is documented, all other functions not. Nevertheless one can be relatively sure that the functions are identical to the documented function RpcWinStationSendMessage and other RpcWinStationXXX functions documented in Terminal Services Terminal Server Runtime Interface. I personally see no need to use the undocumented functions because other documented functions WTSSendMessage, WTSEnumerateSessions (see Remote Desktop Services API) can do the same.

Both functions WTSSendMessage and RpcWinStationSendMessage have parameters pTitle, Style (which can be MB_YESNOCANCEL for example), and pResponse (which can be also interesting you you). So I suggest that you or one from your colleges just write the small utility yourself which you need. You can use documented WTSSendMessage and WTSEnumerateSessions functions in the implementation.

If you'll ask a question of the serverfault.com or superuser.com probably somebody will recommend you an existing utility which you can use.

佞臣 2024-10-13 05:29:57

抱歉,无法更改批处理“msg”命令显示的弹出窗口。

Oleg 所说的是,如果你想创建自定义弹出窗口,则不能使用 Windows“msg”命令来完成。除了创建自己的“msg”命令之外,没有其他方法,该命令会打开一个自定义弹出窗口(Oleg 解释了有很多方法可以做到这一点)。

Sorry but it's not possible to change the popup showed by the batch "msg" command.

What Oleg said is that if you want to create a custom popup, you can't do it with the windows "msg" command. There is no other way than creating your own "msg" command, which opens a custom popup (and there are many ways to do this, explained by Oleg).

黎夕旧梦 2024-10-13 05:29:57

msg * text 在 Windows 10 中不起作用。我编写了一个程序来帮助

@ECHO Off
echo -downloading paused-
echo MsgBox "are you sure you want to download 'msgBox extension' by Ronan? Oh wait ,sigh,I forgot to add the yes or no part...ok,hit ok for yes,or hit the X on the cmd terminal for no." > msg.vbs
msg.vbs
cls
del msg.vbs
echo alrighty then!
pause >nul
cls
@ECHO On
mkdir "msgBox extension"
echo start /min cache\messageB ^& exit > "msgBox extension\messageBox.bat"
echo blank..? > "msgBox extension\text.txt"
mkdir "msgBox extension\cache"
>"msgBox extension\cache\messageB.bat" (
echo set /p var=^< text.txt
echo echo MsgBox " %%var%% " ^> msgbox.vbs
echo msgbox.vbs
echo del msgbox.vbs
echo exit
)
pause
@Echo Off
cls
echo ok,good.you downloaded the software.just for good measure,do a scan of your computer,find viruses, THEN DELETE THE FOLDER ASAP. it means someone stole this program and added viruses to it.ooorrrrrrrr it's something else.
pause >nul
cls
echo now I will tell you how to use the software
echo in a batch file,or cmd prompt,: "msgBox extension\text.txt" will input text into the software. which will be used in : "msgBox extension\messageBox.bat" will display a text box of the imputed text.
echo good luck!
pause >nul

使用它,但在 cmd 或批处理文件中,在此处回显文本 > "msgBox extension\text.txt" 是输入,"msgBox extension\messageBox.bat" 将通过文本框激活它。

the msg * text doesn't work in windows ten.I made a program to help though

@ECHO Off
echo -downloading paused-
echo MsgBox "are you sure you want to download 'msgBox extension' by Ronan? Oh wait ,sigh,I forgot to add the yes or no part...ok,hit ok for yes,or hit the X on the cmd terminal for no." > msg.vbs
msg.vbs
cls
del msg.vbs
echo alrighty then!
pause >nul
cls
@ECHO On
mkdir "msgBox extension"
echo start /min cache\messageB ^& exit > "msgBox extension\messageBox.bat"
echo blank..? > "msgBox extension\text.txt"
mkdir "msgBox extension\cache"
>"msgBox extension\cache\messageB.bat" (
echo set /p var=^< text.txt
echo echo MsgBox " %%var%% " ^> msgbox.vbs
echo msgbox.vbs
echo del msgbox.vbs
echo exit
)
pause
@Echo Off
cls
echo ok,good.you downloaded the software.just for good measure,do a scan of your computer,find viruses, THEN DELETE THE FOLDER ASAP. it means someone stole this program and added viruses to it.ooorrrrrrrr it's something else.
pause >nul
cls
echo now I will tell you how to use the software
echo in a batch file,or cmd prompt,: "msgBox extension\text.txt" will input text into the software. which will be used in : "msgBox extension\messageBox.bat" will display a text box of the imputed text.
echo good luck!
pause >nul

to use it though,in cmd or batch files,echo text here > "msgBox extension\text.txt" is the input,and "msgBox extension\messageBox.bat" will activate it via text box.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文