Advertisement
Guest User

Untitled

a guest
Apr 11th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.49 KB | None | 0 0
  1. @echo off
  2.  
  3. set yourpath=YOUR PATH
  4.  
  5. call :enableSecurity "%yourpath%"
  6.  
  7. echo;
  8. echo;Finished
  9. set /p ".=Press Anything to Exit.."<nul
  10.  
  11.  
  12. pause>nul&exit
  13. :enableSecurity <Path>
  14. pushd %~1
  15. for /f "tokens=* delims=" %%i in ('dir /b /ad') do (
  16.   icacls "%%~i" /grant :r Everyone:^(M^) /deny Everyone:^(DE^) /inheritance:r >nul 2>&1 && (
  17.     echo;[SUCCESS] "%~1\%%~i"
  18.   ) || (
  19.     echo;[ERROR] "%~1\%%~i" (Please Contact The Administrator..ho sorry it's you...well...)
  20.   )
  21. )
  22. popd
  23. Exit /b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement