I'm trying to make a batch script to delete Outlook .ost files bigger than 50GB. But loops with "for" command makes me crazy :( Also try with "forfiles" command but no luky. Any idea?
Hi Dennis!
Sorry for so delayed check out...
I have tested it with small ost's and works... but... the IF command don't work with large files... up to ~2GB. I tried with a 45GB file.
Check this:
IF 2147483647 GTR 2147483646 echo A is greater than B (will be TRUE)
IF 2147483648 GTR 2147483647 echo A is greater than B (will be FALSE!)
Just like show on: How can I check the size of a file in a Windows batch script?
I tried transform into GB but not work:
FORFILES /P "%localappdata%\Microsoft\Outlook" /S /M *.ost /C "cmd /c set /a ostsize=@fsize/1073741824 echo @file"
But not work, then found that there is a problem with forfiles command:
FORFILES /P "%localappdata%\Microsoft\Outlook" /S /M *.ost /C "cmd /c echo=@fsize"
Try it with a 45GB file and returns 8052032512 value... :S I'm stuck!