Fix System Error 5, Access is Denied in Windows
We’ll walk you thru all the steps
If you keep seeing “System error 5 has occurred, Access is denied” repeatedly whilerunning commands in Command PromptorWindows PowerShell, it’s likely that the console lacks the rights needed to execute them. For example, commands involving administrative functions (such as “net user”) oradvanced troubleshootingrequire enhanced privileges or won’t work.
To fix “System error 5” in Microsoft Windows, you must run Command Prompt and Windows PowerShell as an administrator. The instructions below will walk you through multiple ways to open both command-line interpreters with elevated rights.
Run Command Prompt and Windows PowerShell as Administrator
It’s impossible to run commands in Command Prompt or Windows PowerShell with default user privileges. If the command output results in “System error 5,” you must launch your preferred command-line interpreter as an administrator.
-
Open theStartmenu (or press theWindowskey) and typecmdorcommand prompt.
-
Select theRun as administratoroption in the search results.
-
SelectYeson the User Account Control (UAC) dialog box.
Note:User Account Control is not present in Windows 7.
You will then see a Command Prompt window with the “Administrator” label on the title bar. You won’t encounter the “System error 5” while executing commands anymore.
A faster way to open Command Prompt as an administrator involves pressingCtrl+Shift+Enterimmediately after searching for it on the Start menu.
Both Windows 10 and 11 feature the option to open Windows PowerShell as an administrator via the Windows + X (a.k.a. Power User) menu.
-
PressWindows+Xor right-click theStartbutton.
-
SelectWindows Terminal (Admin)orWindows PowerShell (Admin).
-
SelectYeson the User Account Control (UAC) prompt.
You will then see a Windows PowerShell window (or tab if the console launches viaWindows Terminal) with the “Administrator” label. “System error 5” will not show up while executing commands in it.
Alternatively, you can search forpowershellon theStartmenu and selectRun as administratoror pressCtrl+Shift+Enterto open an elevated Windows PowerShell window.
Tip: Learn how toreplace Windows PowerShell with Command Prompton the Windows 10 Power User menu.
Always Run an Elevated Command Prompt and Windows PowerShell Console
It’s possible to build a desktop shortcut in Windows capable of automatically opening Command Prompt or Windows PowerShell as an administrator. That eliminates the chances of mistakenly launching a console with standard user privileges and encountering “System error 5.”
- Depending on the command-line interpreter you want to create a shortcut to, open a File Explorer window and head over to the relevant directory:
Command Prompt —Local Disk C>Windows>System32
Windows PowerShell —Local Disk C>Windows>System32>WindowsPowerShell>v1.0
-
Locate the file labeledcmd(Command Prompt) orpowershell(Windows PowerShell). Then, right-click it and selectShow more options(Windows 11 only) >Send to>Desktop (create shortcut).
-
Right-click the newly createdcmd – Shortcutorpowershell – Shortcuticon on the desktop. Then, selectProperties.
-
Under theShortcuttab, selectAdvanced.
-
Check the box next toRun as administratorand selectOK.
-
SelectApplyandOKto exit the Properties box.
You can now double-click the shortcut and selectYeson the UAC pop-up to open Command Prompt or Windows PowerShell with administrative privileges. Feel free to rename the shortcut to whatever you like.
Disable UAC Prompts for Command Prompt and Windows PowerShell
User Account Control (UAC) is a security feature in Windows Vista, 8, 8.1, 10, and 11 that prevents programs from making changes to the system without permission. However, dealing with UAC prompts each time you want to open Command Prompt or Windows PowerShell with admin rights is distractive.
The quickest way to deal with that is to disable UAC altogether. However, that poses a significant security risk. Or, you can bypass the prompt only for Command Prompt or Windows PowerShell. That’s safer but takes time to set up.
-
Search foruacon theStartmenu and selectOpento launch the User Account Control Settings dialog.
-
Drag the slider toNever notify.
-
SelectOKto deactivate User Account Control system-wide.
To re-activate UAC later, simply go through the steps above and drag the slider to the first or second notch.
Tip:You can also reach the User Account Control Settings dialog by selectingSystem and Security>Change User Account Control settingson theControl Panel.
-
Search forschtaskson theStartmenu and pressEnterto launch the Task Scheduler.
-
Right-clickTask Scheduler Libraryon the sidebar and selectNew Folder.
-
Enter a name for the folder—e.g.,No UAC.
-
Select the newly-created folder on the sidebar and selectCreate Task.
-
Name the task—e.g.,Command Prompt (Admin)and check the box next toRun with highest privileges.
-
Switch to theActionstab and selectNew.
-
SetActiontoStart a programand paste in the file path for the Command Prompt or Windows PowerShell executable:
Command Prompt —C:WindowsSystem32cmd.exe
Windows PowerShell —C:WindowsSystem32WindowsPowerShellv1.0
-
Switch to theConditionstab and uncheckStart the task only if the computer is on AC power. Then, selectOKto save the task.
-
Right-click a vacant area within the desktop and selectNew>Shortcut.
-
Enter the following path, replacingFolder nameandTask namewith the names that you inserted while creating the task:
C:WindowsSystem32schtasks.exe /RUN /TN “Folder nameTask name”
SelectNextto continue.
-
Type in a name for the shortcut and selectFinish.
-
Double-click the shortcut on the desktop that you just created, and a new elevated Command Prompt or Windows PowerShell console will launch without a UAC prompt.
Fix System Error 5 on Standard Windows Accounts
Suppose you encounter “System error 5 has occurred” in a non-administrator account on your PC. In that case, you can still run an enhanced Command Prompt or Windows PowerShell console using the instructions above by inserting an administrator password. If you don’t know it, ask for permission from a user with administrative privileges to the PC.
Alternatively, you canchange a standard account to an admin account(assuming that you’re the owner of your PC) to avoid having to type in an administrator password each time you want to open a command-line interpreter with elevated rights. The steps below apply to Windows 10 and 11.
-
Sign in to your administrator account and selectStart>Settings>Accounts>Family & other users.
-
Select the standard account underOther usersand selectChange account type.
-
SetAccount typetoAdministratorand selectOK.
Fixed: System Error 5 Has Not Occurred
To reiterate, simply running Command Prompt and Windows PowerShell as an administrator will fix the “System error 5” error code in Microsoft Windows. If you use both consoles regularly, taking the time to set up shortcuts that always launch them with elevated privileges (preferably without an annoying User Account Control prompt to deal with) will likely save hours in the long run.
Dilum Senevirathne is a freelance tech writer and blogger with three years of experience writing for online technology publications. He specializes in topics related to iOS, iPadOS, macOS, and Google web apps. When he isn’t hammering away at his Magic Keyboard, you can catch him binge-watching productivity hacks on YouTube.Read Dilum’s Full Bio
Leave a Reply
Your email address will not be published.Required fields are marked*
Comment*
Name*
Email*
Website
Welcome to Help Desk Geek- a blog full of tech tips from trusted tech experts. We have thousands of articles and guides to help you troubleshoot any issue. Our articles have been read over 150 million times since we launched in 2008.
HomeAbout UsEditorial StandardsContact UsTerms of Use
Copyright © 2008-2024 Help Desk Geek.com, LLC All Rights Reserved