AVG is such a terrible product, but the government agency I work for has already paid for it for the next 2 years, so I'm stuck with it.
Anyways... I've found 66 different versions of AVG installed on our PCs. Ouch!
I've written a huge script to try and force the removal of AVG and reinstall it. Works 99.95% of the time.
The issue is sometimes, AVG appears to be installed and working, but it's not.
I thought I could just look to see if avgui.exe and avguix.exe are running along with the service, avgsvc.
But even that fails because it's easy to duplicate AVG in a bad state where all the expected files exist and even the service exists and is running. I already account for the situation if that is not the case, files missing and or service not installed and running.
I need a way to try and run AVG itself, the UI and see if it runs or not.
At the moment I came up with this script below.
hide is simply a shell that runs the avg ui even if it errors out, like file does not exist. It errors silently.
hide "C:\Program Files (x86)\AVG\Av\avgui.exe" /detectGoodAVG
REM Checks If AVG UI Will Run With My Special Command Line Argument
WMIC path win32_process get Caption,Processid,Commandline | findstr /i "detectGoodAVG" | findstr /v "findstr" >NUL 2>NUL
REM ErrorLevel Will Be Zero If AVG Runs OK - Otheerwise It Will Be 1
echo ERRORLEVEL is %ERRORLEVEL%
REM AVG Wont Start
If ERRORLEVEL 1 GoTo AVGIsNOTRunning
REM AVG Started OK
REM AVG Did NOT Start
REM Open AVG UI Only If Installed Successfully
If %AVGStatus% == AvgIsGood (
REM AVG UI Is Working Correctly
REM Echo Good
) else (
REM AVG UI Is NOT Working Correctly
REM Echo Bad
Works if I run it manually after AVG is fully installed. But during the install process, it fails often.
Which is crazy. But I install AVG, then I tried waiting a full 5 minutes, just for testing, after AVG is installed and the UI is open on the screen to run the above and it fails 75% of the time. Yes it works a good 25%.
It's crazy. Any thoughts on how to do this differently (better).
I just can't think of any other way via script to really tell if AVG is working properly as even if in a bad state the AVG Service, avgui.exe, and avguix.exe are running.
I'd really prefer to not have to have the AVG UI open at all if possible. As mine final goal is to have this run silently.
This is the last thing that is needed before I can make it 100% silent.
Thanks for the assistance.