I want to write a bat script to check a text file (log). If the log is over 10M, I want to delete some portion of the file, only keep the last 500 lines, and delete all the old content.
So there are two issues: how can I check the file every 1 minute, and how can I delete only a portion of the content?