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:

                              @echo off                              setlocal                              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\}

\{\} 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

"The command completed successfully." goto end set users=%1 set user=%users:~1,20%## call :sndmsg if "%user%"

"" goto end set user=%users:~26,20%## call :sndmsg 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%"

"" 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