how to find biggest files on pc
How to Find Large Files on Windows 7 & 10 – CMD Forfiles Command
If the capacity of your hard drive is running low, it is time to clean off some files and to find large files on windows. First of all, we have to identify the biggest "space consumers" and there are a couple of ways to do this. The methods below work for all windows versions including windows 10.
Three methods to find large files on windows
Method 1: Using Windows Explorer
You can use windows search to find big files on your computer. To ensure that all files will display, first unhide hidden folders.
Step 1: Type "Show hidden" and click on the "Show Hidden Files and Folders" option.
Step 2: In the "View" tab of the window that opens, under "Files and Folders," check "Show hidden files, folders, and drives." Reverse this process when you're finished.
Step 3:
- Press Win+F to bring forth the Windows Search window.
- Click the mouse in the Search text box in the upper-right corner of the window.
- Type size:gigantic
Select a size range. Click the option that best describes the file sizes you're looking for. Once you make your selection, a list of files will appear.
- Gigantic will display files larger than 128 MB.
- Huge will display files larger than 16 MB but smaller than 128 MB.
- Large will display files larger than 1 MB but smaller than 16 MB.
The search will take some time and show a green progress bar in the address field since it is searching the entire C: drive. In newer versions of Windows, like Windows 10, the size option shows up in the ribbon and not in the search box anymore.
Method 2: Using Cmd – forfiles commands
In this method, we will explain how to find big files using command prompt, forfiles command. Below you have some examples when you need to show files with size 1MB. 100MB, 1GB or more.
How to find large files with a size of 1 MB or more:
forfiles /S /M * /C "cmd /c if @fsize GEQ 1048576 echo @path"
Example:
E:\>forfiles /S /M * /C "cmd /c if @fsize GEQ 1048576 echo @path" "E:\export-GWG01-24032017-22h00.dmp" "E:\Xming.zip" "E:\AgentInstaller_Win64\AgentInstall64.msi" "E:\Dekstop_20200121\extract.csv" "E:\Dekstop_20200121\SpaceSniffer.exe"
This command prints the complete file path. If you need to print just the file name, you can use @file in place of @path.
Command to find files with a size of more than 100MB:
forfiles /S /M * /C "cmd /c if @fsize GEQ 104857600 echo @path"
Find files with size 1 GB or more:
forfiles /S /M * /C "cmd /c if @fsize GEQ 1073741824 echo @path"
For those wanting top 10 files, redirect output to a text file:
forfiles /S /M * /C "cmd /c if @fsize GEQ 1073741824 echo @path > bigfiles.txt"
The command is going to locate all files larger than 1GB and create a text document titled "bigfiles.txt" with their locations. You can then open in excel and sort or use a text editor to weed out the files you don't want
Method 3: Find large files on windows using Powershell
The below PowerShell script is prepared from "Hey Scripting Guy" at https://gallery.technet.microsoft.com/scriptcenter.
The script uses two command line parameters: path and first that you can either modify directly or change from the command line. The path parameter specifies the search root, and the first parameter determines how many folders will be returned.
# --------------------------------------------------------- # ScriptingGamesBeginnerEvent8_PS1.ps1 # ed wilson, msft 8/21/2009 # PS1 version of HSG-08-19-09 http://bit.ly/1d8Rww # # --------------------------------------------------------- Param( [string]$path = "c:\fso", [int]$first = 5 )# end param # *** Function Here *** function Get-DirSize ($path){ BEGIN {} PROCESS{ $size = 0 $folders = @() foreach ($file in (Get-ChildItem $path -Force -ea SilentlyContinue)) { if ($file.PSIsContainer) { $subfolders = @(Get-DirSize $file.FullName) $size += $subfolders[-1].Size $folders += $subfolders } else { $size += $file.Length } } $object = New-Object -TypeName PSObject $object | Add-Member -MemberType NoteProperty -Name Folder ` -Value (Get-Item $path).FullName $object | Add-Member -MemberType NoteProperty -Name Size -Value $size $folders += $object Write-Output $folders } END {} } # end function Get-DirSize Function Get-FormattedNumber($size) { IF($size -ge 1GB) { "{0:n2}" -f ($size / 1GB) + " GigaBytes" } ELSEIF($size -ge 1MB) { "{0:n2}" -f ($size / 1MB) + " MegaBytes" } ELSE { "{0:n2}" -f ($size / 1KB) + " KiloBytes" } }
0 Response to "how to find biggest files on pc"
Post a Comment