Windows:如何显示非阻塞警报/确认窗口?

发布于 2024-07-18 11:59:46 字数 169 浏览 4 评论 0原文

我想实现一个简单的确认/警报框,可以通过 CLI 使用 Windows XP/Vista 批处理脚本调用它。

标准警报框似乎被阻止,这意味着整个批处理脚本将在警报窗口调用时停止,这不是我想要的。

如果需要编码,请提供示例或文档。 语言可以是任何可编译的语言,而不需要中间的虚拟机。

I want to realize a simple confirmation/alert box which can be called using a Windows XP/Vista batch script by CLI.

The standard alert box seems to be blocking which means that the whole batch script will stop at the time of the alert window call which is NOT what I want.

If it needs to be coded, please supply an example or documentation. Language can be anything that is compileable without requiring a virtual machine in between.

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

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

发布评论

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

评论(2

你丑哭了我 2024-07-25 11:59:46

您可以使用 msg 工具:

Send a message to a user.

MSG {username | sessionname | sessionid | @filename | *}
    [/SERVER:servername] [/TIME:seconds] [/V] [/W] [message]

  username            Identifies the specified username.
  sessionname         The name of the session.
  sessionid           The ID of the session.
  @filename           Identifies a file containing a list of usernames,
                      sessionnames, and sessionids to send the message to.
  *                   Send message to all sessions on specified server.
  /SERVER:servername  server to contact (default is current).
  /TIME:seconds       Time delay to wait for receiver to acknowledge msg.
  /V                  Display information about actions being performed.
  /W                  Wait for response from user, useful with /V.
  message             Message to send.  If none specified, prompts for it
                      or reads from stdin.

调用

msg * Some text

不会阻塞。 如果需要,它还具有在设定的时间后再次关闭消息框的良好功能。

不过,顺便说一句,你不应该真正使用这些东西。 独白(如带有 OK 按钮的消息框)的信息效率为 0%(参见 Jef Raskin:人性化界面。第 4-3 节:界面效率测量 em> 或 Aza Raskin:独白框和透明消息Aza Raskin:知道何时停止定量设计 )。

You can use the msg tool:

Send a message to a user.

MSG {username | sessionname | sessionid | @filename | *}
    [/SERVER:servername] [/TIME:seconds] [/V] [/W] [message]

  username            Identifies the specified username.
  sessionname         The name of the session.
  sessionid           The ID of the session.
  @filename           Identifies a file containing a list of usernames,
                      sessionnames, and sessionids to send the message to.
  *                   Send message to all sessions on specified server.
  /SERVER:servername  server to contact (default is current).
  /TIME:seconds       Time delay to wait for receiver to acknowledge msg.
  /V                  Display information about actions being performed.
  /W                  Wait for response from user, useful with /V.
  message             Message to send.  If none specified, prompts for it
                      or reads from stdin.

The call

msg * Some text

doesn't block. It also has the nice capability of closing the message box again after a set amount of time if required.

On a side note, though, you shouldn't really use those things. Monologs (like message boxes with exactly an OK button) have an information efficiency of 0 % (cf. Jef Raskin: The Humane Interface. Section 4–3: Measurement of Interface Efficiency or Aza Raskin: Monolog Boxes and Transparent Messages or Aza Raskin: Know When to Stop Designing, Quantitatively).

墨小沫ゞ 2024-07-25 11:59:46
start MessageBox.vbs

...其中 MessageBox.vbs 包含对 MsgBox 函数的调用。

start MessageBox.vbs

...where MessageBox.vbs contains a call to the MsgBox function.

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