The script below (create_user_list.bat) loops and creates 30 users. It works well on Windows Server2003 but is breaking on Server 2008. The error that is received is 'System error 5 has occured. Access is denied'.

Is there a permision level that needs to be changed in order to run the script?

set number=0

set /A number=%number%+1
if %number% GTR 30 goto end

net user company%number% i3z9nto! /add /comment:"10.5.2011" /expires:never /fullname:"Company User %number%" /passwordchg:no
net localgroup "Remote Desktop Users" company%number% /add

goto start_loop


You need to run it with UAC elevation.

If you're running the batch file directly, right-click and Run As Administrator. If you're doing it from a command prompt, then run cmd.exe as administrator instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.