Script stuck on "Running" even though script finishes on user end.
There is a script I made and the first two commands work just fine but when it comes to the batch portion of the script, it gets stuck on "Running". The software is installed on the user's end. I even write to text file for the :exit section so I know it gets to the end. But for some reason, KACE doesn't exit the script. Is there somewhere I can look to diagnose this? Anyone else run into this issue and maybe have a solution?
0 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
Kiyolaka
3 years ago
What is the specific task the script is doing? It's pretty normal for scripts to get stuck as running if it resets the network or agent connection.
Comments:
-
Its installing software.
@echo off
REM MAKE SURE OUR VARIABLES WORK INSIDE IF
setlocal EnableDelayedExpansion
echo Administrative permissions required. Detecting permissions...> C:\Temp\Brazos\install.txt
net session >nul 2>&1
if %errorLevel% == 0 (
echo Success: Administrative permissions confirmed.>> C:\Temp\Brazos\install.txt
) else (
echo Please Run as Administrator>> C:\Temp\Brazos\install.txt
GOTO done
)
msiexec /package "C:\Temp\Brazos\setup.msi" /quiet
SET location=
IF EXIST "C:\Program Files\Brazos Technology\Maekit\Brazos.SQLServerCEInstaller.exe" SET location=C:\Program Files
IF EXIST "C:\Program Files (x86)\Brazos Technology\Maekit\Brazos.SQLServerCEInstaller.exe" SET location=C:\Program Files (x86)
IF DEFINED location (
SET maekitpath="!location!\Brazos Technology\Maekit"
echo Copying config files>> C:\Temp\Brazos\install.txt
for /R "C:\Temp\Brazos" %%f in (*.config) do (
echo copying %%f>> C:\Temp\Brazos\install.txt
copy "%%f" !maekitpath!
)
REM INSTALL SQLCE
echo installing SQLCE>> C:\Temp\Brazos\install.txt
cd /D !maekitpath!
start Brazos.SQLServerCEInstaller.exe
echo ALL DONE>> C:\Temp\Brazos\install.txt
)
:done
echo Exiting...>> C:\Temp\Brazos\install.txt
endlocal
exit - jleang 3 years ago-
I would try testing it without the admin check logic, first thought is net session may be throwing something off. - Kiyolaka 3 years ago