net send
Kan nogen fortælle mig hvor i nedenstående tekst komputernavnet kommer? jeg har bruge for det der i stedet står "meddelse fra "brugernavn" til ....."Der står "Meddelse fra komputernavn til user"
@echo off
setlocal
If %1=="" goto syntax
If %2=="" goto syntax
set group=%1
set message=%2
set work=#####%message%#####
set work=%work:#####"=%
set message=%work:"#####=%
set message=%message:#####=%
for /f "tokens=1* delims=:" %%i in ('time /t') do set HH=%%i&set MM=%%j
set $tok=1-3
for /f "tokens=1 delims=.:/-, " %%u in ('date /t') do set $d1=%%u
if "%$d1:~0,1%" GTR "9" set $tok=2-4
for /f "tokens=%$tok% delims=.:/-, " %%u in ('date /t') do (
for /f "skip=1 tokens=2-4 delims=/-,()." %%x in ('echo.^|date') do (
set %%x=%%u
set %%y=%%v
set %%z=%%w
set $d1=
set $tok= ))
set TDYY=%yy%
set TDMM=%mm%
set TDDD=%dd%
set log=%temp%\sg%TDYY%%TDMM%%TDDD%.%HH%%MM%
if exist %log% del /q %log%
@echo sndgrp - %group% - %message%
set group=%1
set message=%2
for /f "Skip=2 Tokens=* Delims= " %%i in ('showmbrs %group%') do call :msg "%%i"
for /f "Tokens=*" %%i in ('type %log%') do set line=%%i&call :who
del /q %log%
endlocal
goto :EOF
:syntax
@echo Syntax: SNDGRP "Group Name" "message"
endlocal
goto :EOF
:who
if /i "%line:~0,28%" EQU "The message was successfully" @echo %line%
goto :EOF
:msg
set name=%1
net send %name% %message% >> %log% 2>>&1