Skip to content

Instantly share code, notes, and snippets.

@amarilindra amarilindra/geek.cmd
Last active Jul 18, 2017

Embed
What would you like to do?
Fix Error 0x80070005 - Access is Denied in Windows
@echo off
setlocal
echo.
echo Determine whether we are on an 32 or 64 bit machine
echo.
if "%PROCESSOR_ARCHITECTURE%"=="x86" if "%PROCESSOR_ARCHITEW6432%"=="" goto x86
set ProgramFilesPath=%ProgramFiles(x86)%
goto startResetting
:x86
set ProgramFilesPath=%ProgramFiles%
:startResetting
echo.
if exist "%ProgramFilesPath%Windows Resource KitsToolssubinacl.exe" goto filesExist
echo ***ERROR*** - Could not find file %ProgramFilesPath%Windows Resource KitsToolssubinacl.exe. Double-check that SubInAcl is correctly installed and re-run this script.
goto END
:filesExist
pushd "%ProgramFilesPath%Windows Resource KitsTools"
subinacl.exe /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f
subinacl.exe /subkeyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f
subinacl.exe /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f
subinacl.exe /subdirectories %windir% /grant=administrators=f /grant=system=f
echo FINISHED.
echo.
echo Press any key to exit . . .
pause >NUL
popd
:END
endlocal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.