[Solved] batch script delete .ost bigger than 50 GB


Ok, I found the solution: WMIC to rescue!!!!

Do a wmic query and put into a variable:

for /f "tokens=2 delims==" %%f in ('wmic datafile where "path="\\Users\\%username%\\AppData\\Local\\Microsoft\\Outlook\\" and Extension='ost' and FileSize>'48318382080'" get Name /value ^| find "="') do set "file=%%f"

solved batch script delete .ost bigger than 50 GB