debug=1; diary off if debug delete('log.txt'); !del log.txt diary('log.txt'); diary ON end diary OFF