12 lines
326 B
Batchfile
12 lines
326 B
Batchfile
@echo off
|
|
for /f "tokens=*" %%a in ('type "C:\Scripts\Tasks\System-Tasks\users.txt"') do (
|
|
for %%b in (%%a) do (
|
|
net localgroup Administrators "%%b" /add
|
|
if errorlevel 1 (
|
|
echo Failed to add %%b to Administrators group.
|
|
) else (
|
|
echo User %%b added to Administrators group successfully.
|
|
)
|
|
)
|
|
)
|