필자는 두개의 배치파일을 작성했다.
SNDMSG "message text" User1 User2 User3 . . . Usern
@echo off
if {%1}=={} (echo usage: sndmsg "text" user-list) & (goto :EOF)
if {%2}=={} (echo usage: sndmsg "text" user-list) & (goto :EOF)
:LOOP
if {%2}=={} goto :EOF
net send %2 %1
shift /2
goto :LOOP
:EOF
SNDMSGL "message text" "\Folder\Filename.Ext"
@echo off
if {%1}=={} (echo usage: sndmsgl "text" user-list.txt) & (goto :EOF)
if {%2}=={} (echo usage: sndmsgl "text" user-list.txt) & (goto :EOF)
if not exist %2 (echo %2 not found) & (goto :EOF)
for /f "eol=; Tokens=*" %%i in (%2) do net send %%i %1
:EOF
여기서 \Folder\Filename.Ext는 행당 한명의 사용자를 포함하는 사용자의 목록이다. 주석(첫번째 열이 ;인)은 무시된다.
댓글: