0

I'm trying to add a new Windows user from the command line using these instructions. I'm just trying to add a regular user at this time. The command I'm entering is

net user /add admin-user admin

I get the following messages:

System error 5 has occurred.

Access is denied.

I am running this from an admin account, and I'm able to create a user by going through the regular settings screens. What am I doing wrong? TIA.

Community
  • 1
  • 1
J. Toran
  • 157
  • 2
  • 2
  • 14

1 Answers1

1

I am pretty sure you are not running your CMD as admin.

You can check this by typing net session as found here.

To run your CMD as admin:

  1. Press the windows key
  2. Type cmd
  3. Right click on the localised name of cmd (command prompt)
  4. Click on "Run as Administrator"
maio290
  • 6,440
  • 1
  • 21
  • 38
  • Thank you for the quick reply. This worked. Funny thing is though: I had to do this even when running from the account I had set up to be an admin account. Like I said, I could add an account manually with this admin account. But I had to do the "Run as Administrator" even though I was signed in as an admin-account user. Strange. Thx again. – J. Toran Dec 31 '18 at 09:10
  • This is not strange, this is a security feature. The UAC requires to confirm to run the CMD as admin - if it wouldn't ask for this, any program could do administrative stuff on your machine even if it didn't ask for this privilege which would be much more close to a root user on any unix based system. It's kinda annoying, but it could save you from some malicious software or scripts :) – maio290 Dec 31 '18 at 09:12