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 Command Prompt as Administrator
- Open the Start menu (or press the Windows key) and type cmd or command prompt.
- Select the Run as administrator option in the search results.
- Select Yes on 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 pressing Ctrl + Shift + Enter immediately after searching for it on the Start menu.
Open Windows PowerShell as Administrator
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.
- Press Windows + X or right-click the Start button.
- Select Windows Terminal (Admin) or Windows PowerShell (Admin).
- Select Yes on the User Account Control (UAC) prompt. You will then see a Windows PowerShell window (or tab if the console launches via Windows Terminal) with the “Administrator” label. “System error 5” will not show up while executing commands in it. Alternatively, you can search for powershell on the Start menu and select Run as administrator or press Ctrl + Shift + Enter to open an elevated Windows PowerShell window. Tip: Learn how to replace Windows PowerShell with Command Prompt on 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 labeled cmd (Command Prompt) or powershell (Windows PowerShell). Then, right-click it and select Show more options (Windows 11 only) > Send to > Desktop (create shortcut).
- Right-click the newly created cmd – Shortcut or powershell – Shortcut icon on the desktop. Then, select Properties.
- Under the Shortcut tab, select Advanced.
- Check the box next to Run as administrator and select OK.
- Select Apply and OK to exit the Properties box. You can now double-click the shortcut and select Yes on 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.
Disable User Account Control Completely
- Search for uac on the Start menu and select Open to launch the User Account Control Settings dialog.
- Drag the slider to Never notify.
- Select OK to 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 selecting System and Security > Change User Account Control settings on the Control Panel.
Bypass UAC for Command Prompt and Windows PowerShell Only
- Search for schtasks on the Start menu and press Enter to launch the Task Scheduler.
- Right-click Task Scheduler Library on the sidebar and select New Folder.
- Enter a name for the folder—e.g., No UAC.
- Select the newly-created folder on the sidebar and select Create Task.
- Name the task—e.g., Command Prompt (Admin) and check the box next to Run with highest privileges.
- Switch to the Actions tab and select New.
- Set Action to Start a program and paste in the file path for the Command Prompt or Windows PowerShell executable: Command Prompt — C:\Windows\System32\cmd.exe Windows PowerShell — C:\Windows\System32\WindowsPowerShell\v1.0
- Switch to the Conditions tab and uncheck Start the task only if the computer is on AC power. Then, select OK to save the task.
- Right-click a vacant area within the desktop and select New > Shortcut.
- Enter the following path, replacing Folder name and Task name with the names that you inserted while creating the task: C:\Windows\System32\schtasks.exe /RUN /TN “Folder name\Task name” Select Next to continue.
- Type in a name for the shortcut and select Finish.
- 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 can change 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 select Start > Settings > Accounts > Family & other users.
- Select the standard account under Other users and select Change account type.
- Set Account type to Administrator and select OK.
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.