Skip to content

Instantly share code, notes, and snippets.

@easierbycode
Last active November 18, 2026 22:44
Show Gist options
  • Select an option

  • Save easierbycode/b811da46db069d2fc7995e677afca986 to your computer and use it in GitHub Desktop.

Select an option

Save easierbycode/b811da46db069d2fc7995e677afca986 to your computer and use it in GitHub Desktop.
Test-Path C:\Windows\SystemTemp, C:\Windows\Temp
[Environment]::GetEnvironmentVariable('TEMP','Machine')
reg query HKLM\SOFTWARE\Policies\Google /s
New-Item -ItemType Directory "C:\Program Files\_t", "$env:TEMP\_t"
Remove-Item "C:\Program Files\_t", "$env:TEMP\_t"
Get-CimInstance -Namespace root/SecurityCenter2 -ClassName AntivirusProduct | select displayName
New-Item -ItemType Directory C:\Windows\SystemTemp\_t; Remove-Item C:\Windows\SystemTemp\_t
icacls C:\Windows\SystemTemp
cmd /c dir /a "C:\Program Files\Google"; cmd /c dir /a "C:\Program Files\Google\Chrome"
Remove-Item "C:\Program Files\Google\Chrome" -Recurse -Force
Get-Item "C:\Program Files\Google" -Force | fl FullName,Attributes,LinkType,Target
cmd /c dir /a "C:\Program Files\Google"
icacls "C:\Program Files\Google"
Get-Content C:\Windows\SystemTemp\chrome_installer.log -Tail 5
Remove-Item "C:\Program Files\Google" -Force
icacls "C:\Program Files\Google" /reset /t
icacls "C:\Program Files (x86)\Google"
icacls "C:\Program Files"
icacls "C:\Program Files\Google"
Get-Content C:\Windows\SystemTemp\chrome_installer.log | Select-String 'ERROR' | Select-String -NotMatch 'delete_after_reboot|histogram' | Select-Object -Last 8
Get-ChildItem "C:\Program Files","C:\Program Files (x86)" -Directory -Force | % { $a=(Get-Acl $_.FullName -EA 0).Access.IdentityReference.Value; if ($a -notcontains 'NT AUTHORITY\SYSTEM') { $_.FullName } }
# For any folder it lists, run
takeown /f "<folder>" /r /d y
# then
icacls "<folder>" /reset /t
# to restore the normal inherited permissions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment