Guest User

Untitled

a guest
Jan 22nd, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. @echo off
  2. title Resetting ACLs...
  3.  
  4. setlocal
  5.  
  6. echo.
  7. echo Determine whether we are on an 32 or 64 bit machine
  8. echo.
  9.  
  10. if "%PROCESSOR_ARCHITECTURE%"=="x86" if "%PROCESSOR_ARCHITEW6432%"=="" goto x86
  11.  
  12. set ProgramFilesPath=%ProgramFiles(x86)%
  13.  
  14. goto startResetting
  15.  
  16. :x86
  17.  
  18. set ProgramFilesPath=%ProgramFiles%
  19.  
  20. :startResetting
  21.  
  22. echo.
  23.  
  24. if exist "%ProgramFilesPath%\Windows Resource Kits\Tools\subinacl.exe" goto filesExist
  25.  
  26. echo ***ERROR*** - Could not find file %ProgramFilesPath%\Windows Resource Kits\Tools\subinacl.exe. Double-check that SubInAcl is correctly installed and re-run this script.
  27. goto END
  28.  
  29. :filesExist
  30.  
  31. pushd "%ProgramFilesPath%\Windows Resource Kits\Tools"
  32.  
  33. echo.
  34. echo Resetting ACLs...
  35. echo (this may take several minutes to complete)
  36. echo.
  37. echo IMPORTANT NOTE: For this script to run correctly, you must change
  38. echo the values named YOURUSERNAME to be the Windows user account that
  39. echo you are logged in with.
  40. echo.
  41. echo ==========================================================================
  42. echo.
  43. echo.
  44. subinacl.exe /subkeyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f /grant=restricted=r /grant=Isaac=f /setowner=administrators > %temp%\subinacl_output.txt
  45. echo.
  46. echo.
  47. subinacl.exe /keyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f /grant=restricted=r /grant=Isaac=f /setowner=administrators >> %temp%\subinacl_output.txt
  48. echo.
  49. echo.
  50. subinacl.exe /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f /grant=users=r /grant=everyone=r /grant=restricted=r /setowner=administrators >> %temp%\subinacl_output.txt
  51. echo.
  52. echo.
  53. subinacl.exe /keyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f /grant=users=r /grant=everyone=r /grant=restricted=r /setowner=administrators >> %temp%\subinacl_output.txt
  54. echo.
  55. echo.
  56. subinacl.exe /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f /grant=users=r /setowner=administrators >> %temp%\subinacl_output.txt
  57. echo.
  58. echo.
  59. subinacl.exe /keyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f /grant=users=r /setowner=administrators >> %temp%\subinacl_output.txt
  60. echo.
  61. echo.
  62. echo System Drive...
  63. subinacl.exe /subdirectories %ProgramFilesPath%\ /grant=administrators=f /grant=system=f /grant=users=e >> %temp%\subinacl_output.txt
  64. echo.
  65. echo.
  66. echo Windows Directory...
  67. subinacl.exe /subdirectories %windir%\ /grant=administrators=f /grant=system=f /grant=users=e >> %temp%\subinacl_output.txt
  68. echo.
  69. echo.
  70. echo ==========================================================================
  71. echo.
  72. echo FINISHED.
  73. echo.
  74. echo Press any key to exit . . .
  75. pause >NUL
  76.  
  77. popd
  78.  
  79. :END
  80.  
  81. endlocal
Advertisement
Add Comment
Please, Sign In to add comment