@echo off a: :start trdiag if errorlevel 2 goto exit if errorlevel 1 goto start trcmdiag goto start :exit