SLEEP 1 REM %~dp is the directory of the batch file if exist %~dp\AEInstaller.exe ( if exist %~dp\..\..\..\install\AEInstaller.exe ( DEL %1 ) else ( exit ) MOVE %~dp/AEInstaller.exe %~dp\..\..\..\install\ START %~dp\..\..\..\install\AEInstaller.exe ) ELSE ( START %~dp\AEInstaller.exe )