In Windows 7, is it possible to obtain a list of recently created folders? I recently created a directory for a program that I installed, but I can't remember where I put it, so I'd like to see a list of all folders that have recently been created.


Can't guarantee it's the most efficient way, but you can use Powershell to complete this task. If you know the general area to look it will make it a lot faster. Just replace the Location_to_Search with your path. Like "C:\Program Files".

$Date = (Get-Date).AddDays(-30)
Get-ChildItem -Path <Location_to_Search> -Recurse | Where {$_.PSIsContainer -and $_.CreationTime -lt $Date}

This code builds a Date variable by getting the current date and subtracting 30 days. Then it goes and gets all the directories/files in the location you specify and recursively searches them. It then pipes the STDOUT to a Where statement that checks if the item is a directory and the creation time was within the last 30 days.

  • How can I run this code? – Anderson Green Mar 28 '13 at 4:13
  • You can either add it to a text file and save it as a .PS1 file. Remember before you say it replace the <Location_to_Search> with your path. Then open up Powershell: Start > All Programs > Accessories > Windows Powershell Sorry if that isn't the correct path I've upgraded to 8. You can type Powershell in the run prompt. Then use Set-Location to get to the script's location. Then use .\<Script_Name>.ps1. Quotations if you used spaces. You might have to run this command: Set-ExecutionPolicy Unrestricted – Dion Pezzimenti Mar 28 '13 at 4:14
  • Otherwise just open up Powershell and run each command separately. Powershell is an ambiguous scripting language so it allows you to build variables as long as you don't end the current Powershell process. – Dion Pezzimenti Mar 28 '13 at 4:17
  • Should <Location_to_Search> be replaced with C:\Program Files, or should it be replaced with "C:\Program Files"? When I replace it with either of these and run the program with PowerShell, I see an error message and the window closes immediately (so that I can't even see the output). – Anderson Green Mar 28 '13 at 4:40
  • If the directory path had no spaces in it it would be fine to use no quotations. Since your going to be looking to a directory with spaces you need them. Like so: No Spaces - No Quotes C:\Users\User1\AppData Spaces - Quotes "C:\Program Files\My Application\Some Files" – Dion Pezzimenti Mar 28 '13 at 4:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.