Let’s say there is little to no user data on the drive. AFAIK such a system is going to have approximately 300,000 files (mine has 583k files, but I have some additional software installed).
So, let’s say we’ve got a system with Windows 10 Enterprise and Microsoft Office Pro. This means our forfiles command, on my system, can process a maximum of just under 7 files per second. Then I ran the forfiles command in a directory containing 1024 files. I ran a batch file that spawned 1024 cmd.exes that did nothing. That means the additional time doing the filesize comparison is negligible (for the purposes of our discussion). Now, let’s assume the best case scenario and that the command to be run inside the newly spawned cmd.exe (i.e., “if GEQ 1000000 echo runs at least an order of magnitude quicker than spawning cmd.exe (in my tests, this seems to be the case). That is exactly how the forfiles command is going to work (AFAIK, and, according to my measurements, it *is* how forfiles works). The cmd.exe are spawned serially by the same parent process. YMMV, although my system is a fairly decent system per 2022 standards. Essentially this 7 spawns/sec is the maximum spawn rate Windows 10 can perform on my particular machine. It simply spawned cmd.exe and exited right away in a loop, 1k times.
In fact, I’ve measured the spawn rate of ~7 spawns per second on my 64 bit Windows 10 Enterprise system (i7-10850H 2.7GHz, 32G RAM and a 1TB SSD drive) Not surprisingly it is particularly laborious in Windows. Spawning a new process is a relatively costly procedure for *any* operating system. The suggested solution (forfiles /S /M * /C “cmd /C if GEQ 1000000 echo will spawn a new instance of the Windows command processor (cmd.exe) is spawned for *every* file if finds (!) On a bare bones win 10 system with Office Pro installed, it can take as much as 12 hours to find all of the large files (!) This works, but there is at least one issue: performance! If you know of any way to do this, please let others know by adding comment below. I could not find a way to do this using windows native commands. It’s not useful if someone wants to find the largest 10 files in a folder. forfiles /S /M * /C "cmd /c if GEQ 1073741824 echo shown above, this command allows us to find files having size more than a given value. If you need to print just the file name, you can use in place of to find files with size of more than 100MB forfiles /S /M * /C "cmd /c if GEQ 104857600 echo files with size 1 GB or more. forfiles /S /M * /C "cmd /c if GEQ 1048576 echo c:\users\mike>forfiles /S /M * /C "cmd /c if GEQ 1048576 echo command prints the complete file path.