¿©·¯¸íÀÇ »ç¿ëÀÚ¿¡°Ô ¸Þ½ÃÁö º¸³»±â¿¡¼ ¿©·¯ »ç¿ëÀÚ¿¡°Ô
NET SENDÇϱâÀ§ÇØ ¹èÄ¡ÆÄÀÏÀ» »ç¿ëÇß´Ù. ±×·ìÀ¸·Î
NET SENDÇϱâÀ§ÇØ °ø°³ ÇÁ·Î±×·¥,
SHOWMBRS°ú ¹èÄ¡ÆÄÀÏ
SNDGRP¸¦ »ç¿ëÇÒ ¼ö ÀÖ´Ù.
»ç¿ëÇü½Ä:
SNDGRP "DomainName\GroupName" "message"
¿¹:
SNDGRP "DoA\Accounts Payable" "¶×¶ò¾Æ ¸ðÇÏ´Ï?"
SNDGRP.batÀº ´ÙÀ½°ú °°Àº ³»¿ëÀ» Æ÷ÇÔÇÑ´Ù
@echo off
If %1=="" goto syntax
If %2=="" goto syntax
for /f "tokens=1,2,3,4* delims=/ " %%i in ('date /t') do set TDDAY=%%i&set TDMM=%%j&set TDDD=%%k&set TDYY=%%l
for /f "tokens=1* delims=:" %%i in ('time /t') do set HH=%%i&set MM=%%j
@echo sndgrp log file - %1 - %2 %temp%\sg%TDYY%%TDMM%%TDDD%.%HH%%MM%
for /f "Tokens=1-3* Delims= " %%i in ('showmbrs %1') do call :msg %2 "%%i" "%%j" "%%k" "%%l"
REM ´ÙÀ½ FOR ¸í·ÉÀº 1ÇàÀÌ´Ù.
for /f "Tokens=1-3* Delims= " %%i in (%temp%\sg%TDYY%%TDMM%%TDDD%.%HH%%MM%) do call :who %%i %%j %%k "%%l"
set fix=
set tst=
goto end
:syntax
@echo Syntax: SNDGRP "Group Name" "message"
goto end
:who
if not "%3"=="was" goto end
if not "%1"=="The" goto end
if not "%2"=="message" goto end
set tst=%4
set tst=%tst:"=%
@echo %1 %2 %3 %tst%
goto end
:msg
If not %5=="" goto end
set fix=%2%3%4
set fix=%fix:"""="%
set fix=%fix:"""="%
set fix=%fix:""= %
set tst=%fix:$"="%
if not %tst%==%fix% goto end
set fix=%fix:"=%
net send "%fix%" %1 %temp%\sg%TDYY%%TDMM%%TDDD%.%HH%%MM% 2&1
:end