(view source code of 4allmembers.bat as plain text)
@ECHO OFF
VER | FIND "Windows NT" >NUL
IF ERRORLEVEL 1 GOTO Syntax
:: Parameter checkIF [%2]==[] GOTO Syntax
NET GROUP %1 /DOMAIN >NUL 2>NUL
IF ERRORLEVEL 1 GOTO Syntax
:: Main commandFOR /F "skip=8 tokens=*" %%A IN ('NET GROUP %1 /DOMAIN ^| FIND /V "The command"') DO FOR %%? IN (%%A) DO CALL :Command %%? %*
GOTO End
:CommandSETLOCAL
SET user$=%1
SHIFT
:LoopSHIFT
IF [%1]==[] GOTO Continue
IF %1==# SET command$=%command$% %user$%
IF %1=="#" SET command$=%command$% %user$%
IF NOT %1=="#" IF NOT %1==# SET command$=%command$% %1
GOTO Loop
:ContinueIF "%command$%"==" " GOTO Syntax
CALL %command$%
ENDLOCAL
GOTO:EOF
:SyntaxECHO.
ECHO 4AllMembers, Version 1.10 for Windows NT
ECHO Written by Rob van der Woude
ECHO Execute a command once for each member of a global group
ECHO.
ECHO Usage: 4AllMembers ^<global_group^> ^<command^> [ ^<parameters^> ]
ECHO.
ECHO Command will be executed once for each member of global_group
ECHO Command line parameter(s) "#" will be substituted by user ID
:Endpage last modified: 2025-10-11; loaded in 0.0058 seconds