How do I find the biggest file in a folder and subfolders on the command line?
PowerShell can do this very easily:
Get-ChildItem -Path "C:\SomeParentDirectory" -Recurse | Sort-Object -Descending Length
I have got the solution. Here it is:
SETLOCAL EnableDelayedExpansion
set tes=0
set name=
set path=
for /r %%h in (*.*) do (
IF !tes! LSS %%~zh (
SET tes= %%~zh
SET name= %%~nh
SET path= %%~ph
)
)
echo name = !name! >> Biggest.txt
echo size = !tes! >> Biggest.txt
echo path = !path! >> Biggest.txt