

To understand the aforementioned command better, let us see a few examples:Įxample 1 – if you would like to to find files that are 1 MB or more, then type the following command and press Enter: forfiles /S /M * /C "cmd /c if GEQ 1048576 echo command will search all subdirectories and their files under the current folder with file size greater than or equal to 1MB and return the complete path of the file(s) as output.Įxample 2 – On similar lines, the command to find files having size more than 100 MB would be: forfiles /S /M * /C "cmd /c if GTR 104857600 echo 3 – The command to find files having size more than 1 GB would be: forfiles /S /M * /C "cmd /c if GTR 1073741824 echo the results of the command appear, close the command prompt. Some other attributes can also be used instead or in addition with a :Returns the name of the :Returns the file name without :Returns only the extension of the :Returns the size of the file (in :Returns the last modified date of the Returns the last modified time of the : Checks if the file type is a directory and returns ‘TRUE’ if it is a directory and ‘False’ if it is not.

If is a console command that builds conditional branches.If GEQ size in binary bytes echo terminate after the completion /M * /C enables the command for every file under each subdirectory.

/S is a switch that makes for files search every subdirectory.Here, forfiles is a built-in command that selects a file(s) and executes a command on that file.
