what's the cygwin/Windows equivalent of Linux' notify-send

9.1k Views Asked by At

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.

3

There are 3 best solutions below

3
On BEST ANSWER

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

0
On

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'.

2
On

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.