• ×
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
  • ×
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
Guidelines
Join the HP Community Solve‑a‑thon | Help Others & Share Your Solutions | Live on Zoom | 2:30 PM to 2:30 AM IST | Every Wednesday Click here to know more
Check out our WINDOWS 11 Support Center info about: OPTIMIZATION, KNOWN ISSUES, FAQs, VIDEOS AND MORE.
HP Recommended

It is a HP EliteBook 745 G5 laptop with 128 GB SSD. Now, there are only 10 GB free space left on this drive. I already used the disk cleanup tool in Windows 11 to delete junk and system caches. I plan to find all large files on Windows and backup them to an external drive if possible. How can I find files with large size in Windows 11? I want a quick and easy approach for doing this.

1 REPLY 1
HP Recommended

I have a single-line PowerShell command method for locating large files in Windows 11, tailored specifically for technical users who prefer command-line operations over graphical interfaces.

Open PowerShell as an administrator: Press Win + X and select Windows PowerShell.

Copy the following command and execute it by pressing Enter. The command will automatically traverse the C drive, sort files in descending order by size, and display their full paths and sizes:

Get-ChildItem -Path C:\ -Recurse -ErrorAction SilentlyContinue | Where-Object {$_.Length -gt 500MB} | Sort-Object Length -Descending | Select-Object FullName, @{Name="SizeGB";Expression={[math]::Round($_.Length/1GB,2)}} | Format-Table -AutoSize

To save a list of files larger than 100MB in the user directory to a specified text file, execute the following command:

Get-ChildItem -Path C:\Users\ -Recurse -ErrorAction SilentlyContinue | Where-Object {$_.Length -gt 100MB} | Sort-Object Length -Descending | Select-Object FullName, @{Name="SizeGB";Expression={[math]::Round($_.Length/1GB,2)}} | Out-File "C:\LargeFiles.txt"

Upon execution, a file named ‘LargeFiles.txt’ will be found in the root directory of the C drive, containing details of all large files meeting the specified criteria.

Supplementary Notes

  • ErrorAction SilentlyContinue: Suppresses errors encountered during traversal (e.g., insufficient permissions) to prevent command interruption.
  • The file size threshold (500MB/100MB) may be adjusted as required. For instance, changing it to 1GB will locate files exceeding 1GB.
  • Traversing the entire drive (C:\) may be time-consuming. Specifying a particular directory (e.g., C:\Users\your_username) is recommended to expedite processing.

 

† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the <a href="https://www8.hp.com/us/en/terms-of-use.html" class="udrlinesmall">Terms of Use</a> and <a href="/t5/custom/page/page-id/hp.rulespage" class="udrlinesmall"> Rules of Participation</a>.