Windows restricts privileged commands to be executed only from elevated administrator command prompt. Even if you are an administrator on the PC, you may run into the error 'System error 5 has occurred. Access is denied'. ... To fix the issue, open elevated command prompt and run the same command.