WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: jkjk12 on September 02, 2014, 08:25:50 AM

Title: Net Send type command
Post by: jkjk12 on September 02, 2014, 08:25:50 AM
Net Send is not part of Windows 7.  They have the MSG command but it is to send messages to users and not really used for computer to computer communication.  Does WinBatch have a way to to mimic Net Send so you can send a broadcast message to all Windows 7 workstations on your network? 
Title: Re: Net Send type command
Post by: td on September 02, 2014, 09:30:06 AM
You could get  a list of computers on a domain or workgroup and then execute msg.exe once for each computer.

Here is an VBS example that could possibly be simplified and converted to WinBatch:

http://gallery.technet.microsoft.com/scriptcenter/A-net-messenger-script-for-810f8331 (http://gallery.technet.microsoft.com/scriptcenter/A-net-messenger-script-for-810f8331)

The following article in the Tech. DB discusses problems using the wtsSendMessage function on Windows 7:

http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WIL~Extenders/Terminal~Server+wtsSendMessage~and~Win7.txt (http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WIL~Extenders/Terminal~Server+wtsSendMessage~and~Win7.txt)
Title: Re: Net Send type command
Post by: jkjk12 on September 02, 2014, 09:46:30 AM
thanks for the link.   We are doing away with all VBScripts in our environment and trying to use only PowerShell.    I've yet to find a matching script using PowerShell.  But what I just can't believe is why would Microsoft remove such a useful command as Net Send?   I've discovered the MSG command but so far it does not work, or it only works when I send myself a message or my own PC.  I've yet to get it working when I target a remote PC. 
Title: Re: Net Send type command
Post by: td on September 02, 2014, 12:57:28 PM
I would suspect that MSFT removed the 'Net Send' business for security reasons or at least that is what they would claim.  IIRC, you need to allow remote RPC to get the msg business to work and that is usually disabled.  IIRC and as describe in the Tech DB article, you need to set the key value

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server[AllowRemoteRPC]

to 1 on any and all machines that you want to send messages to or from. 
Title: Re: Net Send type command
Post by: td on September 02, 2014, 01:07:04 PM
Neglected to mention that you don't need to use VBS to use the VB example. It can be translated directly into a WinBatch script.  That said, it obviously wont help any, if remote RPC is disabled.