How can I find user-created files on Windows modified over 10 years ago?

0
28
Asked By CuriousNomad42 On

I'm looking for a way to search my Windows drive for files that I personally created and have not been modified in over 10 years. I want to exclude any system files, temporary files, or anything else that might have been created by software installations. Ideally, I would like the search results in a CSV format. Can someone guide me on how to achieve this?

3 Answers

Answered By TechSavvyDude88 On

You could try using `Get-ChildItem -Attributes !System`, but it may not work perfectly because files in `C:Windows` aren't always flagged as system files. Here's a basic script you could adapt for your situation:
```powershell
$CutoffDate = (Get-Date).AddYears(-10)
$Owner = '{0}{1}' -f $env:USERDOMAIN, $env:USERNAME
Get-ChildItem -Path $path -File | Where-Object -Property CreationTime -lt $CutoffDate | ForEach-Object { Get-Acl $_.FullName } | Where-Object -Property Owner -Like $Owner | Select-Object -Property @{Name='Path';Expression={Resolve-Path $_.path}.providerpath}, Owner, CreationTime
```
It filters files by creation date and owner, which should help you narrow down your search.

Answered By ScriptWizard99 On

One approach is to use PowerShell to check NTFS Streams metadata. You can get a file's streams and filter them based on your needs. Here's a command you can use to check the streams: `Get-Item "C:pathtoyourfile.txt" -Stream *`. You'll need to build a list of files based on the stream you'd like to search, such as files created by the user.

Answered By FileFinderHero On

If you don’t usually create files in `C:Windows`, you can focus on the more common user folders. Check locations like `C:UsersDocuments`, `Desktop`, `Downloads`, etc. It might help you avoid unwanted files and get to the ones you want faster!

CuriousNomad42 -

Yeah, I typically don't use those folders, but I've noticed some shareware seems to have created files there. Thanks for the tip!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.