13

Linux has the command notify-send for sending user notifications to the desktop manager. (In many environments, these show up as pop-ups in the corner of the screen, along with low battery warnings and other system messages.) I use it in monitoring and back-up scripts.

Cygwin doesn't seem to have lib-notify, so is there a Windows equivalent for this command? Web searching has lead me to articles about running batch files from Windows' system tray/notification area, or attempts to clean the system tray up from a batch file, but I haven't found a way to produce unobtrusive user messages from background processes.

Michael Scheper
  • 6,514
  • 7
  • 63
  • 76
  • [`cygwin-ports`](http://sourceware.org/cygwinports/) promises to include notify-send, but I don't seem to be able to install it. Not sure if it's a compatibility or firewall issue at this stage. – Michael Scheper Apr 26 '13 at 03:01
  • Cygwin Ports provides `notify-send` in the `libnotify` package. You will also need a running daemon (any of `notification-daemon`, `mate-notification-daemon`, `xfce4-notifyd`, `notify-osd`, `qtnotifydaemon`, or those builtin to the KDE and Razor-Qt desktop sessions). – Yaakov Mar 12 '14 at 23:12
  • Toast notifications? http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868259.aspx – SSS Dec 03 '14 at 02:37

3 Answers3

17

You can try notifu. It's a kind of command line notification app, so you can use it in cygwin.

Usage: notifu /p title /m message

Prof. Falken
  • 24,226
  • 19
  • 100
  • 173
CodexVarg
  • 502
  • 1
  • 6
  • 20
8

Windows has had this feature since the NT3.51 days that model after the wall(1) command in UNIX. For Pre vista,7,8 systems the command is net send:

net send * "Message"

On newer and professional versions it is msg.exe:

msg "%username%" "Hello World"
msg * "Message"

Samba even has support for the older notification protocol: echo "Hello world" | smbclient -NM HomePC

While for the new post Vista versions one needs to use PsExec/winexe. See the Ubuntu:SE Article on message to windows 7 for more details.

Community
  • 1
  • 1
Dwight Spencer
  • 1,472
  • 16
  • 22
  • I'm on Windows 10 and `msg` isn't on my path. `net` is, but it doesn't have `send` in its documentation. – Daniel Kaplan Jul 24 '21 at 21:49
  • @daniel kaplan, Net send was dropped from vista and on. while msg.exe exists on pro and server editions as part of the messenger service. https://superuser.com/questions/1379843/windows-10-msg-command-mystery – Dwight Spencer Dec 14 '21 at 09:25
2

Try this (for Windows 10+):

https://github.com/Windos/BurntToast

Install via Powershell (as administrator)

Install-Module -Name BurntToast
New-BTAppId
Import-Module BurntToast
New-BurntToastNotification

You can run Powershell commands inside Cygwin by doing powershell.exe -Command 'New-BurntToastNotification'.

CMCDragonkai
  • 6,222
  • 12
  • 56
  • 98