Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 3 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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