Skip to content

Commit aeffa4e

Browse files
authored
Merge pull request #1352 from trycompai/mariano/agent-improvements
[dev] [Marfuen] mariano/agent-improvements
2 parents 2975a08 + 9b4aeee commit aeffa4e

File tree

1 file changed

+6
-2
lines changed
  • apps/portal/src/app/api/download-agent/scripts

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ if not %errorlevel%==0 (
3434
echo A prompt will appear asking for permission. Please click "Yes".
3535
echo If no prompt appears, right-click this file and select "Run as administrator".
3636
echo.
37-
powershell -NoProfile -ExecutionPolicy Bypass -Command "Start-Process -Verb RunAs -FilePath '%comspec%' -ArgumentList '/k','\"%~f0\"' -WorkingDirectory '%cd%'"
38-
echo This window will now close. The setup will continue in the new window.
37+
echo Elevating... A new window will open and remain open after running.
38+
> "%TEMP%\getadmin.vbs" echo Set UAC = CreateObject^("Shell.Application"^)
39+
>> "%TEMP%\getadmin.vbs" echo UAC.ShellExecute "%~f0", "", "", "runas", 1
40+
wscript "%TEMP%\getadmin.vbs" >nul 2>&1
41+
del "%TEMP%\getadmin.vbs" >nul 2>&1
42+
echo This window will now close. The setup will continue in the new (admin) window.
3943
pause
4044
exit /b
4145
)

0 commit comments

Comments
 (0)