1

My system is Windows 10 Pro x64, with the latest updates applied.

When I try to execute any "net" command in cmd (eg: net stop TeamViewer, net users, etc') I get the error "System error 5 has occurred. Access is denied."

I have researched for hours and did every possible solution I saw mentioned anywhere but still no luck. Here are a few facts:

  1. I opened the cmd with admin rights (see screenshot below)
  2. I am the sole PC user with full admin rights.
  3. This happens even if I disable Windows Firewall.
  4. My UAC is disabled and in the registry, EnableLUA is set to 0.
  5. Also in Windows Built-in administrator account, the issue happens.

How can I give myself access to run net commands?

(note: I know there are similar questions on this forum to my question but none of those answers helped my case.)

Error Screenshot

UPDATES:

  1. Please don't recommend answers from posts such as net-user-administrator-activeyes-returns-system-error-5-has-occurred-acces since I already explained in my bullet points why the answers there don't apply for me.
  2. I tried to rebuild my machine using the Media Creation Link as suggested in the comments (repair in-place). Took 5 hours but was not successful and I cannot try again with a boot disk (I recall trying this a few years ago and know it won't help).

Couln't install Windows 10

In reply to @frank:

does this affect all services or just select ones?

All services. Also, any "net" command, even if it's not related to a service (as mentioned in my question)

Can you start and stop the service in services.msc?

Yes. But I need to be able to also stop services via a cmd command to create a batch file.

26
  • 1
    Does this answer your question? "net user administrator /active:Yes" returns "System error 5 has occurred. Access is denied."
    – Moab
    Commented Apr 2, 2020 at 0:26
  • No. Everything in that post (and all other similar questions on this form) I have made bullet points in my question which explains why those answers don't apply to me. For example, the answer there says "You are not part of the Administrators group or you do not have administrator permissions... You need to run command prompt from an elevated permission level." You will see in my bullet points that this answer doesn't help me. Also, it says there "Easiest way to check if you are an administrator on your machine is to use "net localgroup Administrator" - but I can't use any "net" command. Commented Apr 2, 2020 at 0:31
  • Open cmd.exe with Run as Administrator and run: dism.exe /online /cleanup-image /restorehealth Follow this with sfc /scannow Restart when done and test. If this fails, make a temporary new user account, log into the new account and test your work in the new account
    – anon
    Commented Apr 2, 2020 at 0:45
  • 1
    That is extreme and would be the LAST thing to try. Commented Apr 2, 2020 at 1:09
  • 1
    I've got to assume somthing is wrong with the net.exe Commented Apr 2, 2020 at 16:27

1 Answer 1

0

For the sake of the answer I quote @ZviTwersky (thanks to @Didier for the idea):

"Powershell DOES stop services when 1: is run as admin. 2: Using the PS command, "stop-service [service-name]".

So this is actually enough for me. In my batch file I write "@echo off PowerShell.exe -Command stop-service ****" and make a shortcut to it. In the properties of the shortcut I set to run as admin and walla, it works! Since you thought of the PS idea, please write this as an answer so I can accept it. (although it doesn't solve the cmd issue)."

P.S. Unfortunately it did not work for me because powershell complains about the name

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .