JustPaste
HomeCategoriesAboutDonateContactTerms of UsePrivacy Policy
JustPaste

Free online notepad — write and share instantly

Navigate

  • Home
  • Timeline
  • Categories

Info

  • About
  • Donate
  • Contact

Legal

  • Terms of Use
  • Privacy Policy

© 2026 JustPaste.app. All rights reserved.

Made with ♥ by JustPaste

Code to find all .exe instsllrf installed on Windows via PWSH | JustPaste.app
about 1 month ago4 views
👨‍💻Programming

Code to find all .exe instsllrf installed on Windows via PWSH

$exeList = @()
$Denied = @()

# Collect EXEs
Get-ChildItem C:\ -Recurse -File -Include *.exe -ErrorAction SilentlyContinue |
ForEach-Object {
    $exeList += [PSCustomObject]@{
        FullName     = $_.FullName
        CreationTime = $_.CreationTime
    }
}

# Collect Access Denied folders
Get-ChildItem C:\ -Recurse -Directory -Force -ErrorAction SilentlyContinue -ErrorVariable Denied |
Out-Null

# Write EXE list to file
"===== ALL EXE FILES =====" | Out-File "F:\All EXE.txt"
$exeList | Format-List | Out-File "F:\All EXE.txt" -Append

# Add header for denied section
"`n`n===== ACCESS DENIED =====" | Out-File "F:\All EXE.txt" -Append

# Write denied folders
$Denied |
Select-Object TargetObject |
Format-List |
Out-File "F:\All EXE.txt" -Append
← Back to timeline