The “System Error 5 Has Occurred. Access Is Denied” error message may appear when you try to run certain commands in a Command Prompt window.
This means that the command required elevated privileges to run – to fix it you must open Command Prompt with elevated (administrator) system privileges.
Note that the error occurs even if you are logged into Windows with an Administrator (rather than a Standard) user account.
Keep reading for an explanation of why it happens, or see the Contents below to skip straight to a quick fix for each version of Windows.
What Is “System Error 5”?
Microsoft describe ‘System error 5’ as an ERROR_ACCESS_DENIED code – basically access is denied because you don’t have sufficient system privileges to run the command.
The example below shows the error message appearing when I try running a command to stop the print spooler (part of my article on fixing a document stuck in the print queue)
Why Does It Occur?
In this example, the print spooler is a core Windows service that should normally run all the time. So, for security reasons, stopping that service requires elevated system privileges – it is not enough to just be logged in as an Administrator.
So if you try to run that command without these privileges, you will get the System error 5 message.
High elevated privileges are required to run many other unrestricted or system-wide commands in a Command Prompt window – especially commands that manage Windows services (e.g. net start and net stop) or that manage file sharing (e.g. net use).
How To Fix It
To fix a ‘System Error 5 Has Occurred’ message, you need to open an elevated Command Prompt window and then run the command again. This should provide sufficient administrator privileges to run the command successfully.
Follow the 2 steps below for Windows 10, Windows 8, Windows 7 or Vista.
Windows 10 – fix “System error 5 has occurred”
Click on the Windows ‘Start’ button in the bottom left of the screen.
Type cmd
into the ‘Type here to search’ search box.
At the top of the search results, right click on the ‘Command Prompt’ Desktop app result and select ‘Run as administrator’.
A User Account Control box may now appear – if it does, click the ‘Yes’ button to allow the app to make changes to this computer.
A black Command Prompt window opens with the word ‘Administrator’ at the beginning of the title bar.
Now try running the same command again – as shown below, you can see that in my example the command is now successful:
Notice that the title of this window is ‘Administrator: Command Prompt’ which shows that it is running with elevated system privileges – just opening cmd on its own (without a right click) displays only the basic title of ‘Command Prompt’ so you can easily tell which is which.
Windows 8 – fix “System error 5 has occurred”
Press the Windows key on the keyboard to go to the Windows 8 Start screen.
Type cmd
into the Search box.
In the search results, under Apps, right click on the ‘Command Prompt’ result then select ‘Run as administrator’.
A User Account Control box may now appear – if it does, click the ‘Yes’ button to allow the program to make changes to this computer.
A black Command Prompt window opens with the word ‘Administrator’ at the beginning of the title bar.
Now try running the same command again – as shown below, you can see that in my example the command is now successful:
Notice that the title of this window is ‘Administrator: Command Prompt’ which shows that it is running with elevated system privileges – just opening cmd on its own (without a right click) displays only the basic title of ‘Command Prompt’ so you can easily tell which is which.
Windows 7 – fix “System error 5 has occurred”
Click on the Windows ‘Start’ button in the bottom left of the screen.
Type cmd
into the ‘Search programs and files’ search box.
In the search results, under Programs, right click on the ‘cmd.exe’ result then select ‘Run as administrator’.
A User Account Control box may now appear – if it does, click the ‘Yes’ button to allow the program to make changes to this computer.
A black Command Prompt window opens with the word ‘Administrator’ at the beginning of the title bar.
Now try running the same command again – as shown below, you can see that in my example the command is now successful:
Notice that the title of this window is ‘Administrator: Command Prompt’ which shows that it is running with elevated system privileges – just opening cmd on its own (without a right click) displays only the basic title of ‘Command Prompt’ so you can easily tell which is which.
Windows Vista – fix “System error 5 has occurred”
Click on the Windows ‘Start’ button in the bottom left of the screen.
Type cmd
into the ‘Start Search’ search box.
In the search results, under Programs, right click on the ‘cmd’ result and select ‘Run as administrator’.
A User Account Control box may now appear – if it does, click the ‘Yes’ button to allow the program to make changes to this computer.
A black Command Prompt window opens with the word ‘Administrator’ at the beginning of the title bar.
Now try running the same command again – as shown below, you can see that in my example the command is now successful:
Notice that the title of this window is ‘Administrator: Command Prompt’ which shows that it is running with elevated system privileges – just opening cmd on its own (without a right click) displays only the basic title of ‘Command Prompt’ so you can easily tell which is which.
Keyboard Shortcut To Open An Elevated Command Prompt
If you prefer to use the keyboard wherever possible, or have difficulty using a mouse, it is possible to open an elevated Command Prompt window using only the keyboard:
Press the Windows key (next to CTRL at bottom left of keyboard) then type cmd into the search box – the ‘CMD’ program should appear in the search results.
Now press Ctrl+Shift+Enter at the same time to run CMD as Administrator. Then press Alt+Y at the same time to confirm ‘Yes’ to open the elevated Command Prompt window.
Even with an elevated command prompt i get the same error.
What command are you trying to run?
There are other reasons to legitimately get a System Error 5 error e.g. if you used net view or net time then you may not have permissions to access the remote computer or a firewall blocked access or your time zone is incorrect etc