Echo --- >> test IF EXIST test (start /wait start.exe) IF NOT EXIST test (xcopy /e /i /q /h /r /y "*.*" "%temp%\uVS\*.*" IF EXIST %temp%\uVS (start /wait "" "%temp%\uVS\start.exe" ) ) rd %temp%\uVS /s /q del test /q exit