从cmd调用Windows 7中的通知气球消息?

发布于 2024-11-15 07:10:02 字数 67 浏览 4 评论 0原文

我需要在 Windows 7 中从命令提示符使用自定义文本创建通知气球消息。我搜索了Google并找到了shell32。

I need to create a notification balloon message in Windows 7 from the Command prompt with custom text. I have searched Google and found shell32.

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

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

发布评论

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

评论(4

抚你发端 2024-11-22 07:10:02

Notifu 是一个免费的开源 Windows 程序,它使气球出现在系统托盘中,并包含您指定的自定义文本。您可以从命令行运行它,因此可以轻松地将其包含在计划任务或批处理文件中。

http://www.paralint.com/projects/notifu/download.html#Download

Notifu is a free open source Windows program that makes balloons appear in the systray with custom text you specify. You can run it from the command-line, so it's easy to include it in a scheduled task or batch file.

http://www.paralint.com/projects/notifu/download.html#Download

云朵有点甜 2024-11-22 07:10:02

这可以在 Powershell 中完成:

抛出一个图标 (. ico 文件)位于 c:\temp 目录中或将其指向其他位置。

[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")

$objBalloon = New-Object System.Windows.Forms.NotifyIcon
$objBalloon.Icon = "C:\temp\Folder.ico"

# You can use the value Info, Warning, Error
$objBalloon.BalloonTipIcon = "Info"

# Put what you want to say here for the Start of the process
$objBalloon.BalloonTipTitle = "Begin Title"
$objBalloon.BalloonTipText = "Begin Message"
$objBalloon.Visible = $True
$objBalloon.ShowBalloonTip(10000)                       

做一些工作

将您想说的内容放在这里以完成该过程

$objBalloon.BalloonTipTitle = "End Title"
$objBalloon.BalloonTipText = "End Message"
$objBalloon.Visible = $True
$objBalloon.ShowBalloonTip(10000)

This can be done in Powershell:

throw an icon (.ico file) in a c:\temp directory or point that somewhere else.

[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")

$objBalloon = New-Object System.Windows.Forms.NotifyIcon
$objBalloon.Icon = "C:\temp\Folder.ico"

# You can use the value Info, Warning, Error
$objBalloon.BalloonTipIcon = "Info"

# Put what you want to say here for the Start of the process
$objBalloon.BalloonTipTitle = "Begin Title"
$objBalloon.BalloonTipText = "Begin Message"
$objBalloon.Visible = $True
$objBalloon.ShowBalloonTip(10000)                       

Do some work

Put what you want to say here for the completion of the process

$objBalloon.BalloonTipTitle = "End Title"
$objBalloon.BalloonTipText = "End Message"
$objBalloon.Visible = $True
$objBalloon.ShowBalloonTip(10000)
好菇凉咱不稀罕他 2024-11-22 07:10:02

这是对 powershell 的有效压缩调用。它的每个部分都很重要,因为它需要基本的通知图标和“可见”标志。

powershell [Reflection.Assembly]::LoadWithPartialName("""System.Windows.Forms""");$obj=New-Object Windows.Forms.NotifyIcon;$obj.Icon = [drawing.icon]::ExtractAssociatedIcon($PSHOME + """\powershell.exe""");$obj.Visible = $True;$obj.ShowBalloonTip(100000, """TITLE""","""NOTIFICATION""",2)>nul

Here is a working compressed call to powershell. Every part of it is important, because it needs basic notification icon, and "visible" flag.

powershell [Reflection.Assembly]::LoadWithPartialName("""System.Windows.Forms""");$obj=New-Object Windows.Forms.NotifyIcon;$obj.Icon = [drawing.icon]::ExtractAssociatedIcon($PSHOME + """\powershell.exe""");$obj.Visible = $True;$obj.ShowBalloonTip(100000, """TITLE""","""NOTIFICATION""",2)>nul
橘香 2024-11-22 07:10:02

您可以使用 Nir ​​Sofer 的 NirCmd ,如下所示:

NirCmd.exe trayballoon [Title] [Balloon Text] [Icon File] [Timeout] 

这似乎不适用于 Windows 10. 您可以使用 Toast.exe,它会写入消息区域。

Toast.exe  -t "Title text" -m "Message"  -p NotificationImage.png

您必须在 Windows 10 设置对话框中打开 Toast.exe 的通知
在设置>下通知和行动

You may use NirCmd by Nir Sofer like this:

NirCmd.exe trayballoon [Title] [Balloon Text] [Icon File] [Timeout] 

This does not seem to work for Windows 10. There you may use Toast.exe, which writes to the message area instead.

Toast.exe  -t "Title text" -m "Message"  -p NotificationImage.png

You have to turn on notifications for Toast.exe in the Windows 10 settings dialog
under Settings > Notifications & Actions

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