Log all deleted files

Welcome Forums General PowerShell Q&A Log all deleted files

  • This topic has 4 replies, 2 voices, and was last updated 6 months ago by
    Participant
    .
Viewing 4 reply threads
  • Author
    Posts
    • #241361
      Participant
      Topics: 16
      Replies: 58
      Points: 70
      Rank: Member

      Hi ,

      Need help, i cleaning computer and want to log all files that was deleted

      This is what i do

      Get-ChildItem "C:\Windows\SoftwareDistribution\*" -Recurse -Force -ErrorAction SilentlyContinue | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue<br />Get-ChildItem "C:\Windows\Temp\*" -Recurse -Force -ErrorAction SilentlyContinue | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue<br />Get-ChildItem "C:\Windows\prefetch\*" -Recurse -Force -ErrorAction SilentlyContinue | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue<br />Get-ChildItem "C:\Users\*\AppData\Local\Temp" -Force -ErrorAction SilentlyContinue | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue<br />Get-ChildItem "C:\Users\*\AppData\Local\Microsoft\Windows\Temporary Internet Files" -Recurse -Force -ErrorAction SilentlyContinue | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue<br />Get-ChildItem "C:\Users\*\AppData\Local\Microsoft\Windows\INetCookies\*" -Recurse -Force -ErrorAction SilentlyContinue | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue<br />Get-ChildItem "C:\swsetup" -Recurse -Force -ErrorAction SilentlyContinue | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue<br />Get-ChildItem 'C:\Users\*\AppData\Local\CrashDumps\*' | remove-item -Force -recurse -ErrorAction SilentlyContinue<br />Get-ChildItem 'C:\Users\*\AppData\Local\Microsoft\Windows\WER*' | remove-item -Force -recurse -ErrorAction SilentlyContinue

      Thanks.

    • #241391
      Participant
      Topics: 9
      Replies: 701
      Points: 2,815
      Helping Hand
      Rank: Community Hero
    • #241661
      Participant
      Topics: 16
      Replies: 58
      Points: 70
      Rank: Member

      Thank you Doug

    • #241769
      Participant
      Topics: 9
      Replies: 701
      Points: 2,815
      Helping Hand
      Rank: Community Hero

      You’re welcome. That do all you needed?

    • #242153
      Participant
      Topics: 16
      Replies: 58
      Points: 70
      Rank: Member

      Yes, Thank you Doug

Viewing 4 reply threads
  • The topic ‘Log all deleted files’ is closed to new replies.