@echo off set FILE="C:\temp\MotorTestTool\server1.ttcfg" :: Check file if exist %FILE% ( del %FILE% echo Finish:%FILE% ) else ( echo Error:%FILE% )