@echo off setlocal EnableDelayedExpansion :: ====================================================================================== :: DYNAMIC CONFIGURATION :: ====================================================================================== set "AppRoot=D:\WORK\test x(0)" set "ExeName=zxc\wah.exe" :: ====================================================================================== :: STATIC CONFIGURATION :: ====================================================================================== set "BatRoot=%~dp0" if "%BatRoot:~-1%"=="\" set "BatRoot=%BatRoot:~0,-1%" set "SwapRoot=%BatRoot%\%RepositoryName%" set "RepositoryName=whygwnfsis-repository" :: MARKERS set "OrigSwapExt=.origswapped-whygwnfsis" set "SwapExt=.whygwnfss" set "InjExt=.whygwnfis" set "InconsistExt=.inconsistent-whygwnfsis" :: ====================================================================================== :: FULLSCREEN FORCE :: ====================================================================================== if not "%1"=="max" ( start /max "" "%~0" max exit /b ) set NL=^ :: DRIVE AVAILABILITY CHECK if not exist "%AppRoot%" ( echo [ ERROR ] Drive or App Folder NOT FOUND: "%AppRoot%" echo Please ensure your External Drive is connected. pause exit ) for %%I in ("%AppRoot%") do set "BaseFolder=%%~nxI" :CHECK_STATUS cls set "TotalFiles=0" set "PrepCount=0" set "SwappedCount=0" set "OriginalCount=0" set "MissingInRoot=0" for /f "tokens=1 delims==" %%v in ('set _f_ 2^>nul') do set "%%v=" if not exist "%SwapRoot%" ( echo [ ERROR ] Repository "%RepositoryName%" NOT FOUND. pause exit ) set "GLOBAL_PATCHED=0" dir "%AppRoot%\*%OrigSwapExt%" /s /b >nul 2>&1 && set "GLOBAL_PATCHED=1" for /f "delims=" %%A in ('dir "%SwapRoot%" /s /b /a-d 2^>nul') do ( set /a TotalFiles+=1 set "full_p=%%A" set "file_nx=%%~nxA" set "rel_p=!full_p:*%SwapRoot%\=!" set "this_ext=%%~xA" set "_f_!TotalFiles!_full=%%A" set "_f_!TotalFiles!_raw_nx=%%~nxA" set "_f_!TotalFiles!_ext=!this_ext!" set "current_is_prep=0" if /i "!this_ext!"=="%SwapExt%" set "current_is_prep=1" if /i "!this_ext!"=="%InjExt%" set "current_is_prep=1" if !current_is_prep! equ 1 ( set /a PrepCount+=1 for %%F in ("!file_nx!") do set "clean_nx=%%~nF" set "temp_rel=!rel_p!" set "clean_rel=!temp_rel:%%~nxA=!!clean_nx!" ) else ( set "clean_rel=!rel_p!" set "clean_nx=!file_nx!" ) set "_f_!TotalFiles!_is_prep=!current_is_prep!" set "_f_!TotalFiles!_rel=!clean_rel!" set "_f_!TotalFiles!_name=!clean_nx!" if exist "%AppRoot%\!clean_rel!%OrigSwapExt%" ( set "_f_!TotalFiles!_status=SWAPPED" set /a SwappedCount+=1 ) else if /i "!this_ext!"=="%InjExt%" ( if exist "%AppRoot%\!clean_rel!" ( set "_f_!TotalFiles!_status=INJECTED" set /a SwappedCount+=1 ) else ( set "_f_!TotalFiles!_status=UNINJECTED" set /a OriginalCount+=1 ) ) else ( set "_f_!TotalFiles!_status=UNSWAPPED" set /a OriginalCount+=1 ) ) set "SHOW_EMERGENCY=0" dir "%AppRoot%\*%InconsistExt%" /s /b >nul 2>&1 && set "SHOW_EMERGENCY=1" if %SwappedCount% GTR 0 if %OriginalCount% GTR 0 set "SHOW_EMERGENCY=1" set "INCONSISTENT_FOUND=0" dir "%AppRoot%\*%InconsistExt%" /s /b >nul 2>&1 && set "INCONSISTENT_FOUND=1" if %INCONSISTENT_FOUND% equ 1 ( set "DIAG_MSG=!DIAG_MSG!- ATTENTION: Manually marked assets detected.!NL!" set "DIAG_MSG=!DIAG_MSG! Run '00. PREPARE Assets' to resolve them.!NL!" ) set "DIAG_MSG=" set "PREP_ENGINE_ST=UNLOCKED" set "SWAP_ENGINE_ST=UNLOCKED" set "PREP_LOCKED=0" set "SHOW_LAUNCH=0" if %SwappedCount% equ %TotalFiles% ( if %TotalFiles% GTR 0 set "SHOW_LAUNCH=1" ) else if %OriginalCount% equ %TotalFiles% ( if %TotalFiles% GTR 0 set "SHOW_LAUNCH=1" ) else ( if %SwappedCount% GTR 0 if %OriginalCount% GTR 0 ( set "DIAG_MSG=!DIAG_MSG!- WARNING: INCONSISTENT STATUS DETECTED.!NL!" ) ) if %TotalFiles% equ 0 ( set "DIAG_MSG=!DIAG_MSG!- BLOCKER: Repository is empty.!NL!" set "PREP_ENGINE_ST=LOCKED (Empty)" set "SWAP_ENGINE_ST=LOCKED (Empty)" goto DISPLAY_RENDER ) if %SwappedCount% GTR 0 ( set "PREP_LOCKED=1" set "PREP_ENGINE_ST=LOCKED" set "DIAG_MSG=!DIAG_MSG!- INFO: Prepare Engine LOCKED (Assets are currently SWAPPED/INJECTED).!NL!" ) if %PrepCount% LSS %TotalFiles% ( set "SWAP_ENGINE_ST=LOCKED" set /a "PendingCount=%TotalFiles% - %PrepCount%" set "DIAG_MSG=!DIAG_MSG!SUMMARY: %PrepCount% of %TotalFiles% files are READY.!NL!" set "DIAG_MSG=!DIAG_MSG!SUMMARY: !PendingCount! of %TotalFiles% files are PENDING.!NL!" set "DIAG_MSG=!DIAG_MSG!!NL!" set "DIAG_MSG=!DIAG_MSG!%TotalFiles% assets still PENDING (Prepare Step Incomplete)" ) if %SwappedCount% GTR 0 if %OriginalCount% GTR 0 set "SWAP_ENGINE_ST=RECOVERY MODE" if "!DIAG_MSG!"=="" ( set /a "PendingCount=%TotalFiles% - %PrepCount%" set "DIAG_MSG=!DIAG_MSG!SUMMARY: %PrepCount% of %TotalFiles% files are READY.!NL!" set "DIAG_MSG=!DIAG_MSG!SUMMARY: !PendingCount! of %TotalFiles% files are PENDING.!NL!" set "DIAG_MSG=!DIAG_MSG!!NL!" set "DIAG_MSG=!DIAG_MSG!All %TotalFiles% assets are READY (Prepare Step Complete)" ) :DISPLAY_RENDER set "SHOW_PREP=1" if %SwappedCount% equ %TotalFiles% if %TotalFiles% GTR 0 set "SHOW_PREP=0" set "SHOW_SWAP=0" if %PrepCount% equ %TotalFiles% set "SHOW_SWAP=1" if %SwappedCount% GTR 0 set "SHOW_SWAP=1" echo ================================================================================ echo FILE SWAPIN SENTINEL v10.0.0 - FSIS v10.0.0 by whygwn echo ================================================================================ echo. echo INITIAL WORK PATH : %BatRoot% echo. echo CONFIGURATION echo ------------- echo APP ROOT (AppRoot) : %AppRoot% echo TARGET EXE (ExeName) : %ExeName% echo SWAPIN FOLDER (RepositoryName) : %RepositoryName% echo EXTENSION (SwapExt, InjExt) : %SwapExt% (Swap), %InjExt% (Inject) echo. echo -------------------------------------------------------------------------------- echo. if %SHOW_PREP% equ 1 ( echo PREPARE LIST echo ------------ for /L %%i in (1,1,%TotalFiles%) do ( if "!_f_%%i_is_prep!"=="1" ( echo READY : %RepositoryName%\!_f_%%i_rel!!_f_%%i_ext! ) else ( echo PENDING : %RepositoryName%\!_f_%%i_rel! ) ) echo. ) if %SHOW_SWAP% equ 1 ( echo PATCH LIST echo ---------- for /L %%i in (1,1,%TotalFiles%) do ( echo ASSET : %RepositoryName%\!_f_%%i_rel!!_f_%%i_ext! echo TARGET : %BaseFolder%\!_f_%%i_rel! [ !_f_%%i_status! ] ) echo. ) echo -------------------------------------------------------------------------------- echo. echo DIAGNOSTIC echo ---------- echo !DIAG_MSG! echo STATUS: Prepare Engine is %PREP_ENGINE_ST%. echo STATUS: Patch Engine is %SWAP_ENGINE_ST%. echo. echo -------------------------------------------------------------------------------- echo. set "ANY_PREP=0" if %PREP_LOCKED% equ 0 if %TotalFiles% GTR 0 set "ANY_PREP=1" if %ANY_PREP% equ 1 ( echo PREPARE COMMAND echo --------------- if %PrepCount% LSS %TotalFiles% echo 00. PREPARE Assets if %PrepCount% GTR 0 echo 01. REVERT Assets echo. ) set "ANY_SWAP=0" if "%SWAP_ENGINE_ST%"=="UNLOCKED" set "ANY_SWAP=1" if %SwappedCount% GTR 0 set "ANY_SWAP=1" if %ANY_SWAP% equ 1 ( echo PATCH COMMAND echo ------------- if "%SWAP_ENGINE_ST%"=="UNLOCKED" ( if %SwappedCount% LSS %TotalFiles% echo 1. APPLY PATCH - SWAP/INJECT ) if %SwappedCount% GTR 0 ( if %SHOW_EMERGENCY% equ 1 ( echo 12345. EMERGENCY RESTORE ) else ( echo 2. RESTORE ORIGINAL - UNSWAPPED/UNINJECTED ) ) if "%SWAP_ENGINE_ST%"=="UNLOCKED" ( if %SHOW_LAUNCH% equ 1 ( if %SwappedCount% equ %TotalFiles% ( echo 3. LAUNCH PATCHED - %ExeName% ) else ( echo 3. LAUNCH ORIGINAL - %ExeName% ) ) ) echo. ) echo SENTINEL COMMAND echo ---------------- echo 0. RESCAN echo 99. EXIT SENTINEL echo. :ACTION_PROMPT set "ch=" set /p ch="Command >> " if "%ch%"=="0" goto CHECK_STATUS if "%ch%"=="99" exit if "%ch%"=="00" ( if %PREP_LOCKED% equ 0 if %PrepCount% LSS %TotalFiles% goto DO_PREPARE ) if "%ch%"=="01" ( if %PREP_LOCKED% equ 0 if %PrepCount% GTR 0 goto DO_REVERT ) if "%ch%"=="1" ( if "%SWAP_ENGINE_ST%"=="UNLOCKED" if %SwappedCount% LSS %TotalFiles% goto DO_INSTALL ) if "%ch%"=="2" ( if %SwappedCount% GTR 0 goto DO_RESTORE ) if "%ch%"=="3" ( if "%SWAP_ENGINE_ST%"=="UNLOCKED" if %SHOW_LAUNCH% equ 1 goto DO_EXECUTE ) if "%ch%"=="12345" ( if %SHOW_EMERGENCY% equ 1 goto DO_EMERGENCY ) echo INVALID COMMAND goto ACTION_PROMPT :DO_PREPARE echo PROCESS LOG : Initiating Asset Resolution and Preparation . . . set "FORCE_RESOLVE_MODE=" rem --- STAGE 1: ORPHAN ASSETS (INCONSISTENT BUT NOT IN REPOSITORY) --- echo [ STAGE 1 ] Checking for Orphan Inconsistent Assets . . . set "FORCE_ORPHAN_MODE=" for /f "delims=" %%F in ('dir "%AppRoot%\*%InconsistExt%" /s /b 2^>nul') do ( set "full_path=%%F" set "rel_path=!full_path:%AppRoot%\=!" set "is_matched=0" for /L %%i in (1,1,%TotalFiles%) do ( if /i "!rel_path!"=="!_f_%%i_rel!%InconsistExt%" set "is_matched=1" ) if "!is_matched!"=="0" ( set "rel=!rel_path!" if "!FORCE_ORPHAN_MODE!"=="" ( call :SUB_DISPLAY_RESOLVE_ORPHAN ) else ( set "choice=!FORCE_ORPHAN_MODE!" ) if /i "!choice!"=="D" ( attrib -r "%%F" >nul 2>&1 del /f /q "%%F" echo [RESOLVED] : !rel_path! DELETED ) else if /i "!choice!"=="S" ( echo [SKIPPED] : !rel_path! NO CHANGES MADE ) else if /i "!choice!"=="K" ( attrib -r "%%F" >nul 2>&1 for %%A in ("%%F") do ren "%%F" "%%~nA" echo [RESOLVED] : !rel_path! KEPT ^(MARKER REMOVED^) ) if "!FORCE_ORPHAN_MODE!"=="" pause ) ) rem --- STAGE 2: PRIORITY RESOLUTION (MATCHED INCONSISTENT ASSETS) --- echo. echo [ STAGE 2 ] Resolving Matched Inconsistent Assets . . . for /L %%i in (1,1,%TotalFiles%) do ( set "rel=!_f_%%i_rel!" set "target_inc=%AppRoot%\!rel!%InconsistExt%" set "current_full=!_f_%%i_full!" set "current_name=!_f_%%i_name!" if exist "!target_inc!" ( if "!FORCE_RESOLVE_MODE!"=="" ( call :SUB_DISPLAY_RESOLVE ) else ( set "choice=!FORCE_RESOLVE_MODE!" ) if /i "!choice!"=="I" ( attrib -r "!target_inc!" >nul 2>&1 del /f /q "!target_inc!" ren "!current_full!" "!current_name!%InjExt%" echo [RESOLVED] : !rel! AS INJECT ) else if /i "!choice!"=="W" ( attrib -r "!target_inc!" >nul 2>&1 for %%F in ("!target_inc!") do ren "!target_inc!" "%%~nF" ren "!current_full!" "!current_name!%SwapExt%" echo [RESOLVED] : !rel! AS SWAP ) else ( echo [SKIPPED] : !rel! ) if "!FORCE_RESOLVE_MODE!"=="" pause ) ) rem --- STAGE 3: NORMAL PREPARATION (CLEAN ASSETS) --- set "ANY_NORMAL_PENDING=0" for /L %%i in (1,1,%TotalFiles%) do ( set "rel=!_f_%%i_rel!" set "target_in_root=%AppRoot%\!rel!" set "target_inc=!target_in_root!%InconsistExt%" set "current_ext=!_f_%%i_ext!" if not exist "!target_inc!" ( if /i "!current_ext!" NEQ "%SwapExt%" if /i "!current_ext!" NEQ "%InjExt%" ( set "ANY_NORMAL_PENDING=1" ) ) ) if "%ANY_NORMAL_PENDING%"=="1" ( echo. echo [ STAGE 3 ] Preparing Remaining Assets . . . for /L %%i in (1,1,%TotalFiles%) do ( set "rel=!_f_%%i_rel!" set "target_in_root=%AppRoot%\!rel!" set "target_inc=!target_in_root!%InconsistExt%" set "current_full=!_f_%%i_full!" set "current_name=!_f_%%i_name!" set "current_ext=!_f_%%i_ext!" if not exist "!target_inc!" ( if /i "!current_ext!" NEQ "%SwapExt%" if /i "!current_ext!" NEQ "%InjExt%" ( if exist "!target_in_root!" ( ren "!current_full!" "!current_name!%SwapExt%" echo [PREP: SWAP] : !rel! ) else ( ren "!current_full!" "!current_name!%InjExt%" echo [PREP: INJECT] : !rel! ) ) ) ) ) else ( echo. echo No remaining assets to prepare. ) echo. echo Operation Complete. pause & goto CHECK_STATUS :SUB_DISPLAY_RESOLVE_ORPHAN cls echo -------------------------------------------------------------------------------- echo --- ORPHAN INCONSISTENT ASSETS ^(NO REPOSITORY MATCH^) --- echo -------------------------------------------------------------------------------- for /f "delims=" %%G in ('dir "%AppRoot%\*%InconsistExt%" /s /b 2^>nul') do ( set "p_inc=%%G" set "r_inc=!p_inc:%AppRoot%\=!" set "r_raw=!r_inc:%InconsistExt%=!" set "is_orph=1" for /L %%k in (1,1,%TotalFiles%) do ( if /i "!r_raw!"=="!_f_%%k_rel!" set "is_orph=0" ) if "!is_orph!"=="1" ( if /i "!r_inc!"=="!rel!" ( echo ^> [ORPHAN] !r_inc! ) else ( echo [ORPHAN] !r_inc! ) ) ) echo ================================================================================ echo SINGLE ACTIONS: echo [D] DELETE : Permanently remove orphaned file. echo [K] KEEP : Keep file, remove marker only. echo [S] SKIP : Do nothing ^(Default on ENTER^). echo -------------------------------------------------------------------------------- echo BULK ACTIONS: echo [DA] DELETE ALL ^| [KA] KEEP ALL ^| [SA] SKIP ALL echo ================================================================================ :PROMPT_ORPHAN set "choice=S" set /p "choice=Action >> " if /i "!choice!"=="DA" ( set "FORCE_ORPHAN_MODE=D" & set "choice=D" & exit /b ) if /i "!choice!"=="KA" ( set "FORCE_ORPHAN_MODE=K" & set "choice=K" & exit /b ) if /i "!choice!"=="SA" ( set "FORCE_ORPHAN_MODE=S" & set "choice=S" & exit /b ) for %%v in (D K S) do ( if /i "!choice!"=="%%v" exit /b ) echo INVALID COMMAND & goto PROMPT_ORPHAN :SUB_DISPLAY_RESOLVE cls echo -------------------------------------------------------------------------------- echo --- LIST INCONSISTENT TARGETS ^(MATCHED FROM REPOSITORY^) --- echo -------------------------------------------------------------------------------- for /L %%j in (1,1,%TotalFiles%) do ( set "check_rel=!_f_%%j_rel!" set "check_inc=%AppRoot%\!check_rel!%InconsistExt%" if exist "!check_inc!" ( if "!check_rel!"=="%rel%" ( echo ^> [MATCH] !check_rel! ) else ( echo [MATCH] !check_rel! ) ) ) echo ================================================================================ echo SINGLE ACTIONS: echo [I] INJECT : Deletes target, repo asset becomes INJECT. echo [W] SWAP : Restores original, repo asset becomes SWAP. echo [S] SKIP : No changes ^(Default on ENTER^). echo -------------------------------------------------------------------------------- echo BULK ACTIONS: echo [IA] INJECT ALL ^| [WA] SWAP ALL ^| [SA] SKIP ALL echo ================================================================================ :PROMPT_MATCH set "choice=S" set /p "choice=Action >> " if /i "!choice!"=="IA" ( set "FORCE_RESOLVE_MODE=I" & set "choice=I" & exit /b ) if /i "!choice!"=="WA" ( set "FORCE_RESOLVE_MODE=W" & set "choice=W" & exit /b ) if /i "!choice!"=="SA" ( set "FORCE_RESOLVE_MODE=S" & set "choice=S" & exit /b ) for %%v in (I W S) do ( if /i "!choice!"=="%%v" exit /b ) echo INVALID COMMAND & goto PROMPT_MATCH :DO_REVERT echo PROCESS LOG : Reverting . . . for /L %%i in (1,1,%TotalFiles%) do ( if "!_f_%%i_is_prep!"=="1" ( ren "!_f_%%i_full!" "!_f_%%i_name!" if /i "!_f_%%i_ext!"=="%SwapExt%" ( echo FROM: %RepositoryName%\!_f_%%i_rel!!_f_%%i_ext! [SWAP] ) else ( echo FROM: %RepositoryName%\!_f_%%i_rel!!_f_%%i_ext! [INJECT] ) echo TO: %RepositoryName%\!_f_%%i_rel! ) ) echo. pause & goto CHECK_STATUS :DO_INSTALL echo PROCESS LOG : Applying patch . . . for /L %%i in (1,1,%TotalFiles%) do ( set "rel=!_f_%%i_rel!" set "target_p=%AppRoot%\!rel!" for %%D in ("!target_p!") do if not exist "%%~dpD" mkdir "%%~dpD" if "!_f_%%i_ext!"=="%SwapExt%" ( if exist "!target_p!" ( if not exist "!target_p!%OrigSwapExt%" ( attrib -r "!target_p!" >nul 2>&1 ren "!target_p!" "!_f_%%i_name!%OrigSwapExt%" copy /y "!_f_%%i_full!" "!target_p!" >nul echo [OK] SWAPPED: !rel! ) ) ) else if "!_f_%%i_ext!"=="%InjExt%" ( copy /y "!_f_%%i_full!" "!target_p!" >nul echo [OK] INJECTED: !rel! ) ) echo. pause & goto CHECK_STATUS :DO_RESTORE echo PROCESS LOG : Restoring Original . . . set "CleanList=%temp%\fsis_cleanup.tmp" if exist "%CleanList%" del "%CleanList%" for /L %%i in (1,1,%TotalFiles%) do ( set "rel=!_f_%%i_rel!" set "target_p=%AppRoot%\!rel!" for %%D in ("!target_p!") do ( set "p_dir=%%~dpD" echo !p_dir!>>"%CleanList%" ) if exist "!target_p!%OrigSwapExt%" ( if exist "!target_p!" del /f /q "!target_p!" ren "!target_p!%OrigSwapExt%" "!_f_%%i_name!" echo [OK] RESTORED: !rel! ) else ( if exist "!target_p!" ( del /f /q "!target_p!" echo [OK] REMOVED: !rel! ) ) ) echo. echo PROCESS LOG : Cleaning created directories . . . if exist "%CleanList%" ( for /f "usebackq delims=" %%D in (`sort /r "%CleanList%" ^| powershell -Command "$input | Get-Unique"`) do ( set "cdir=%%~D" if "!cdir:~-1!"=="\" set "cdir=!cdir:~0,-1!" echo "!cdir!" | findstr /i /c:"%AppRoot%\\" >nul if !errorlevel! equ 0 ( rd "!cdir!" 2>nul && echo [CLEAN] Removed empty folder: !cdir! ) ) del "%CleanList%" 2>nul ) echo. pause & goto CHECK_STATUS :DO_EMERGENCY echo [!] EMERGENCY RESTORE INITIATED [!] echo ----------------------------------- echo 1. Reverting all markers in Repository... set "idx=1" :LOOP_PREP_EM if %idx% GTR %TotalFiles% goto :START_SYNC_EM if "!_f_%idx%_is_prep!"=="1" ( ren "!_f_%idx%_full!" "!_f_%idx%_name!" echo [CLEAN] Repo: !_f_%idx%_raw_nx! -^> !_f_%idx%_name! ) set /a idx+=1 goto :LOOP_PREP_EM :START_SYNC_EM echo. echo 2. Syncing AppRoot with Repo List... set "idx=1" :LOOP_SYNC_EM if %idx% GTR %TotalFiles% goto :END_EM set "rel=!_f_%idx%_rel!" set "target_p=%AppRoot%\!rel!" set "repo_p=%SwapRoot%\!rel!" set "f_name=!_f_%idx%_name!" if NOT exist "!target_p!" goto :NEXT_EM :: CEK KASUS SWAP if exist "!target_p!%OrigSwapExt%" ( del /f /q "!target_p!" ren "!target_p!%OrigSwapExt%" "!f_name!" echo [FIXED] Restored Original: !rel! goto :NEXT_EM ) :: CEK KASUS INKONSISTEN (METADATA) for %%A in ("!target_p!") do set "sz_t=%%~zA" for %%A in ("!target_p!") do set "dt_t=%%~tA" for %%B in ("!repo_p!") do set "sz_r=%%~zB" for %%B in ("!repo_p!") do set "dt_r=%%~tB" :: BANDINGKAN TANPA BLOK KURUNG SAMA SEKALI if NOT "!sz_t!"=="!sz_r!" echo [SKIP] File Size differs: !rel! & goto :NEXT_EM if NOT "!dt_t!"=="!dt_r!" echo [SKIP] File Time differs: !rel! & goto :NEXT_EM :: JIKA IDENTIK for %%F in ("!target_p!") do ( attrib -r "!target_p!" >nul 2>&1 :: Nama baru HARUS nama file saja (%%~nxF) ditambah ekstensi marker ren "!target_p!" "%%~nxF%InconsistExt%" ) echo [MARKED] Inconsistent File (Identical): !rel!%InconsistExt% :NEXT_EM set /a idx+=1 goto :LOOP_SYNC_EM :END_EM echo. echo Emergency Restore Complete. pause goto CHECK_STATUS :DO_EXECUTE echo. if exist "%AppRoot%\%ExeName%" ( echo [EXEC] Launching %ExeName%... start "" /d "%AppRoot%" "%ExeName%" exit ) if exist "%AppRoot%\bin\x64\%ExeName%" ( echo [EXEC] Launching %ExeName%... start "" /d "%AppRoot%\bin\x64" "%ExeName%" exit ) echo [!] Executable not found. echo Path: "%AppRoot%\%ExeName%" pause & goto CHECK_STATUS