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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |