Make Home Folders for many users at 1 time, using DOS parsing

 

@ECHO OFF
for /f "Tokens=1" %%i in (c:\file.txt) do call :parse %%i
goto end

:parse

if exist X:\folder\%1 goto :NEXT
md X:\folder\%1
:NEXT
XCACLS X:\folder\%1 /T /C /P domain\%1:C "domain\DOMAIN ADMINS":F domain\ADMINISTRATOR:F /Y

Note: the lower case domain above should be the name of your domain.

 

format of c:\file.txt (this file can have as many lines in it as you need.

lsmith
rjones
btoby
amantle