# command tricks

### powershell

- icacls ./file 
    - PS C:\\Log-Management&gt; icacls .\\job.bat  
        .\\job.bat BUILTIN\\Users:(F)  
         NT AUTHORITY\\SYSTEM:(I)(F)  
         BUILTIN\\Administrators:(I)(F)  
         BUILTIN\\Users:(I)(RX)
        
        Successfully processed 1 files; Failed processing 0 files
- type .\\file  
    
    - PS C:\\Log-Management&gt; type .\\job.bat  
        @echo off  
        FOR /F "tokens=1,2\*" %%V IN ('bcdedit') DO SET adminTest=%%V  
        IF (%adminTest%)==(Access) goto noAdmin  
        for /F "tokens=\*" %%G in ('wevtutil.exe el') DO (call :do\_clear "%%G")  
        echo.  
        echo Event Logs have been cleared!  
        goto theEnd  
        :do\_clear  
        wevtutil.exe cl %1  
        goto :eof  
        :noAdmin  
        echo You must run this script as an Administrator!  
        :theEnd  
        exit
- Get-ChildItem -Path C:\\ -Filter Log-Management -Recurse -ErrorAction SilentlyContinue -Force 
    - it finds a file from a path
- a

<div id="bkmrk-a">a</div><div id="bkmrk-a-1">something is wrong with this version of the editor as of writing, so it will be messy / full of copy/paste. idk how to raw html encode some of this  
</div>### cmd

<div id="bkmrk-n-a-a">- n
- a
- a

<div>  
</div></div>### shell

<div id="bkmrk-n-a-a-2"><div><div>- n
- a
- a

</div></div></div>