Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ECHO ON
- SETLOCAL ENABLEDELAYEDEXPANSION
- SET "Exe=%userprofile%\Desktop\Vendas Pay&Go\Enviar Vendas Eco.exe"
- SET "uAccount=Todos"
- FOR %%a in ("%Exe%") DO SET "eFolder=%%~DPa"
- ::: This strips the last "\" from the folder the exe resides so icacls can process
- SET "eFolder=!eFolder:~0,-1!"
- ::: Disables ACL inheritence on the folder the exe file resides but copies all ACLs as inherited before removing
- ICACLS "!eFolder!" /inheritance:d /grant:r "%uAccount%:(OI)(IO)" /C
- ::: Remove all granted permission ACLs on only the folder the exe file resides
- ICACLS "!eFolder!" /remove:g "%uAccount%" /C
- ::: Remove all denied permission ACLs on only the folder the exe file resides
- ICACLS "!eFolder!" /remove:g "%uAccount%" /C
- ::: Grants explicit read and execute ACL access on only the folder the exe file resides
- ICACLS "!eFolder!" /grant:r "%uAccount%:(RX)" /C
- ::: Denies delete ACL access on only the folder the exe file resides
- ICACLS "!eFolder!" /deny "%uAccount%":(DE)
- ::: Denies create files / write data ACL access on only the folder the exe file resides
- ICACLS "!eFolder!" /deny "%uAccount%":(WD)
- ::: Disables ACL inheritence on the exe file only but copies all ACLs as inherited before removing
- ICACLS "%Exe%" /inheritance:d /grant:r "%uAccount%:(OI)(IO)" /C
- ::: Remove all granted permission ACLs on only the exe file
- ICACLS "%Exe%" /remove:g "%uAccount%" /C
- ::: Remove all denied permission ACLs on only the exe file
- ICACLS "%Exe%" /remove:g "%uAccount%" /C
- ::: Grants explicit read and execute ACL access only to the exe file
- ICACLS "%Exe%" /grant:r "%uAccount%:(RX)" /C
- ::: Grants an explicit deny of delete ACL access only to the exe file
- ICACLS "%Exe%" /deny "%uAccount%":(DE)
- PAUSE
Advertisement
Add Comment
Please, Sign In to add comment