2
1
I would like to search for folders with a certain number of files, but currently I cannot figure out the syntax on how to achieve this. I have searched the Windows Search site, but have only found document specific syntax. I am trying to organize my files between multiple devices and it is becoming a pain to have to look at each folder, just to see the amount of files. Can you help me?
OS Used: Microsoft Windows 7 Home Premium Edition Service Pack 1 (build 7601), 64-bit Update-
$NumFiles = 4
$Directory = (Get-ChildItem "C:\Windows*" -ErrorAction -force)
Get-ChildItem -path $Directory -recurse -include *.exe `
| Sort-Object Name | Format-Table Name, Fullname -auto
$NumFiles + (Get-ChildItem "C:\Windows").Count
I was wondering if anyone who viewed this question, would be willing to give me a "spoonfeedy" answer for this? I'm not fluent in C or powershell, and this is just a one-time thing I'd like to do. Basically I just to search a folder for all subfolders containing 10-or-less files.
What do I download and what's the command? – CreeDorofl – 2015-03-07T03:03:25.880
The Windows 7 search quite simply ... sucks (personal opinion) ... in any case, this requirement is not possible with that tool. FWIW, here is what Microsoft Says.
– None – 2011-05-31T04:40:58.917Here is the "full list" (perhaps) of search terms.
– None – 2011-05-31T04:47:53.127what do you mean by organizing files? Are you trying to keep folders synchronized? Are you trying to make sure that you have an even distribution of files in every folder? – Paxxi – 2011-05-31T11:55:17.947
I want to see if there are, for example, 4 files in a folder and that will determine which folder to edit. I basically want to search the folder, find how many files are in it, output the results to a table. – win7guru – 2011-05-31T16:05:16.650
I found a wonderful resource that can calculate the size of the files http://technet.microsoft.com/en-us/library/ff730945.aspx
– win7guru – 2011-06-01T05:57:50.813