Guest User

testing

a guest
Jun 30th, 2018
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. @ECHO ON
  2. SETLOCAL ENABLEDELAYEDEXPANSION
  3. SET "Exe=%userprofile%\Desktop\Vendas Pay&Go\Enviar Vendas Eco.exe"
  4. SET "uAccount=Todos"
  5. FOR %%a in ("%Exe%") DO SET "eFolder=%%~DPa"
  6. ::: This strips the last "\" from the folder the exe resides so icacls can process
  7. SET "eFolder=!eFolder:~0,-1!"
  8.  
  9. ::: Disables ACL inheritence on the folder the exe file resides but copies all ACLs as inherited before removing
  10. ICACLS "!eFolder!" /inheritance:d /grant:r "%uAccount%:(OI)(IO)" /C
  11. ::: Remove all granted permission ACLs on only the folder the exe file resides
  12. ICACLS "!eFolder!" /remove:g "%uAccount%" /C
  13. ::: Remove all denied permission ACLs on only the folder the exe file resides
  14. ICACLS "!eFolder!" /remove:g "%uAccount%" /C
  15. ::: Grants explicit read and execute ACL access on only the folder the exe file resides
  16. ICACLS "!eFolder!" /grant:r "%uAccount%:(RX)" /C
  17. ::: Denies delete ACL access on only the folder the exe file resides
  18. ICACLS "!eFolder!" /deny "%uAccount%":(DE)
  19. ::: Denies create files / write data ACL access on only the folder the exe file resides
  20. ICACLS "!eFolder!" /deny "%uAccount%":(WD)
  21.  
  22. ::: Disables ACL inheritence on the exe file only but copies all ACLs as inherited before removing
  23. ICACLS "%Exe%" /inheritance:d /grant:r "%uAccount%:(OI)(IO)" /C
  24. ::: Remove all granted permission ACLs on only the exe file
  25. ICACLS "%Exe%" /remove:g "%uAccount%" /C
  26. ::: Remove all denied permission ACLs on only the exe file
  27. ICACLS "%Exe%" /remove:g "%uAccount%" /C
  28. ::: Grants explicit read and execute ACL access only to the exe file
  29. ICACLS "%Exe%" /grant:r "%uAccount%:(RX)" /C
  30. ::: Grants an explicit deny of delete ACL access only to the exe file
  31. ICACLS "%Exe%" /deny "%uAccount%":(DE)
  32.  
  33.  
  34. PAUSE
Advertisement
Add Comment
Please, Sign In to add comment