Send or Receive a Message from/to a Windows Machine
Sending a Message
MS/Windows can send a message to another MS/Windows PC which will
pop-up and appear in a dialog box. This is used by admins for
notification purposes. The DOS command is:
NET SEND NetBIOS-computer-name "Message to send to user"
Linux can send the same message to a MS/Windows PC using the command:
linux$ smbclient -M NetBIOS-computer-name
Message to send to user
ctrl-d
If smbclient isn’t installed you need to, do for Debian and Ubuntu:
apt-get install smbclient
Small Notes:
- Message limit is 1600 bytes.
- Alternate method:
cat mymessage.txt | smbclient -M NetBIOS-computer-name
Receiving a Message
To handle incoming messages on Linux, set the “message command” parameter in the smb.conf.
message command = csh -c 'xedit %s;rm %s' &
This will use the application “xedit” to display the message. The message is then removed.
- %s : The file-name containing the message.
- %t : Message destination (computer or server to which it was sent.)
- %f : Message sender.
Default smb.conf config file is no message command.
Before it works you need to put your needed IP and Netbios name in “/etc/samba/lmhosts” – NETBIOS name resolution
Update: also check if the service is active on you windows machine. You start it by typing it in the cmd:
net start messenger