In tip 1024 I scripted sndfle.bat to send the contents of a text file to a list of users.

sndflegrp.bat will send the contents of a text file to the members of a domain global group. The sysntax is:

sndflegrp filename group1 \[group2 group3 ... groupN\]

where

Filename is the name of the text file, either single or multi-line, that contains the message text.

Groupx is a list of global groups, separated by a space, who's members should receive the message.

Note: The maximum length of the message text is 887 characters.

sndflegrp.bat contains:

<b>
@echo off
setlocal
if \{%2\}<h1><a name="_echo_usage_sndflegrp_msgfile_user_list_amp_goto_end_if_not_exist_1_echo_usage_sndflegrp_msgfile_user_list_amp_goto_end_for_f_Tokens_i_in_type_1_do_call_setmsg_##_i_##_set_msg_msg_##_set_msg_msg_##_LOOP_if_2_">\{\} (echo usage: sndflegrp msgfile user-list) & (goto end)
if not exist %1 (echo usage: sndflegrp msgfile user-list) & (goto end)
for /f "Tokens=*" %%i in ('type %1') do call :setmsg ##"%%i"##
set msg=%msg:##"=%
set msg=%msg:"##=%
:LOOP
if \{%2\}</a></h1>\{\} endlocal&goto end
for /f "Skip=6 Tokens=*" %%i in ('net group %2 /domain') do call :msg "%%i"
shift /2
goto :LOOP
:msg
If %1<h1><a name="_The_command_completed_successfully_goto_end_set_users_1_set_user_users_1_20_##_call_sndmsg_if_user_">"The command completed successfully." goto end
set users=%1
set user=%users:~1,20%##
call :sndmsg
if "%user%"</a></h1>"" goto end
set user=%users:~26,20%##
call :sndmsg
if "%user%"<h1><a name="_goto_end_set_user_users_51_20_##_call_sndmsg_goto_end_sndmsg_set_user_user_set_user_user_##_##_set_user_user_##_set_user_user_if_user_">"" goto end
set user=%users:~51,20%##
call :sndmsg
goto end
:sndmsg
set user=%user:  =%
set user=%user: ##=##%
set user=%user:##=%
set user=%user:"=%
if "%user%"</a></h1>"" goto end
set comp=%user%
set comp=%comp:$=%
if "%comp%"=="%user%" net send "%user%" %msg%
goto end
:setmsg
if not defined msg set msg=%1&goto end
set msg=%msg%%1
:end</b>