Skip to content

Commit bfad924

Browse files
committed
fix: add persistent cmd session support in Windows script
- Implemented a mechanism to relaunch the script in a persistent command window if not already running in one. - Enhanced user experience by ensuring the command window remains open after script completion for better visibility of output and errors.
1 parent 2705540 commit bfad924

File tree

1 file changed

+8
-0
lines changed
  • apps/portal/src/app/api/download-agent/scripts

1 file changed

+8
-0
lines changed

apps/portal/src/app/api/download-agent/scripts/windows.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ if errorlevel 1 (
3838
pause
3939
exit /b 5
4040
)
41+
42+
REM Ensure this script runs in a persistent cmd session that stays open after completion
43+
if not "%PERSIST%"=="1" (
44+
set "PERSIST=1"
45+
echo Re-launching in a persistent window...
46+
start "CompAI Device Setup" cmd /k "%~f0 %*"
47+
exit /b
48+
)
4149
echo Running with administrator privileges.
4250
echo Current directory: %cd%
4351
echo Script path: %~f0

0 commit comments

Comments
 (0)