[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 8409
  • Last Modified:

Unattended / Silent uninstall of AVG Antispyware 7.5

Hi!

Is it possible to run a command or some kind of script to automatically uninstall AVG AntiSpyware Free from client machines? I wish to run such automated uninstall on user logon.

Thank you!
0
Zaurb
Asked:
Zaurb
  • 9
  • 8
1 Solution
 
VorenusCommented:
running :

"%ProgramFiles%\Grisoft\AVG Anti-Spyware 7.5\Uninstall.exe" /S

seems to have worked for me (using the trial version from their website I just downloaded).

Any more help needed, please let me know.

Cheers.
0
 
VorenusCommented:
By the way, a reboot seems to be required to fully complete the uninstallation, but the uninstaller happily doesn't reboot on its own.

Actually, the required reboot seems to be related to context menu and shell extensions so no big deal and can wait the user to shutdown his computer at the end of the day.

REGISTRY: PendingFileRenameOperations
 > DELETE C:\Program Files\Grisoft\AVG Anti-Spyware 7.5\context.dll
 > DELETE C:\Program Files\Grisoft\AVG Anti-Spyware 7.5\shellexecutehook.dll
 > DELETE C:\Program Files\Grisoft\AVG Anti-Spyware 7.5\
 > DELETE C:\Program Files\Grisoft\
0
 
ZaurbAuthor Commented:
Hi!

I've tried /s, /q, /qn, /silent, /quiet and many other switches. Doesn't work in my case though. Maybe because of the italian version of Windows we're running. I've created a script using AutoIt, however, I would prefer running a command line script rather than recorded actions.

Any more ideas? Thank you very much!
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
VorenusCommented:
Hi Zaurb,

Make sure you are using an uppercase /S as in my post rather than the lowercase /s that you seem to have tried...
I tried it and confirmed it : /s won't work while /S does (on the version I downloaded)

If that still doesn't work, do you know if I can download the same version as yours somewhere so I can see what I can do ?

If not, please post your AutoIT script... there may be ways to make it more reliable (especially if you are using the Send function, for example), but I agree with you that it will never beat a command-line...
0
 
ZaurbAuthor Commented:
Hi! I've tried with /S switch and it doesn't work either.

Indeed, my script requires some modifications, because it's very basic which I've created for running a test uninstall. I steel need to add a function which would create a log file and/ or place 1 single file in a shared dir named as a machine name where the script will run when launched with the outcome, i.e. Fail/Success.

The script I've made is:
Run("C:\Programmi\Grisoft\AVG Anti-Spyware 7.5\Uninstall.exe")
WinWaitActive("Disinstallazione di AVG Anti-Spyware 7.5")
Send("!a")
WinWaitActive("Disinstallazione di AVG Anti-Spyware 7.5")
Send("!d")
WinWaitActive("Disinstallazione di AVG Anti-Spyware 7.5")
Send("{ENTER}")
Send("{ENTER}")
WinWaitActive("Disinstallazione di AVG Anti-Spyware 7.5", "&Fine")
Send("{ENTER}")
DirRemove ("C:\Programmi\Grisoft", 1)


The problem with AutoIt in my case is that on some machines the version of AVG might be other than 7.5. Another thing to think of.

Thank you very much!
0
 
VorenusCommented:
Please can you upload the installer for the italian version somewhere or at least the Uninstall.exe file somewhere ? I would like to take a look inside the binary code to see if I find something.
On the grisoft italian website, I think they only have an evaluation version but not the free version.

Regarding your AutoIT script, I suggest that you use ControlSend instead of Send.
ControlSend makes sure that the keys will be delivered to the proper window and not to a window that could take away the focus.
In your actual code, if a window takes the focus away from the uninstaller, the keys will be sent to the window having "stolen" the focus. It would probably work for many users but for some users your script may stop halfway due to that.

The ControlClick function is even a better choice.
Here is a quick example that will click a button named "&Option" (& being for the keyboard shortcut underscore below the letter)
ControlClick($strMainCaption, "", "[TEXT:&Options]")

You can find more information on them from the AutoIT help.
0
 
ZaurbAuthor Commented:
OK. Try to download it from here.
Thanks!
0
 
VorenusCommented:
Hi,

Thanks for the file.
That seems to be the same installer that I downloaded earlier and seems to be multilanguage.

I retried it with this installer nevertheless and the /S switch works for me (tested under a virtual machine running Windows XP SP2 French).
I even retried by choosing the italian language at the Setup and it still works.

Please can you copy paste the two lines below to a batch file, run it and let me know if it works ?

cd /D "%ProgramFiles%\Grisoft\AVG Anti-Spyware 7.5"
start /wait Uninstall.exe /S

Do you get an error message when running the uninstaller with the /S switch ?
0
 
VorenusCommented:
If it still doesn't work, please upload the Uninstall.exe file from a workstation where the /S switch and my batch file above doesn't work.
0
 
ZaurbAuthor Commented:
It worked fine! Just left a directory with context.dll undeleted. Probably it needs restart.
The rest is perfect! Do you know which other options would work? Thank you!
0
 
VorenusCommented:
Great... glad it worked...
It is normal that the context.dll and shell extension is normal... they are scheduled to be deleted at the next windows reboot as I shown in my second post : it is because they are in use by Explorer.exe and can't be deleted when the uninstaller runs.
If you reboot, they should be gone.

What kind of others options would you need aside from that ? I think that it doesn't support a lot of switches anyway.
0
 
VorenusCommented:
You have some additionnal options there but it is nothing useful :
http://nsis.sourceforge.net/Docs/Chapter3.html#3.2.2
0
 
ZaurbAuthor Commented:
Thank you very much for your help!
0
 
ZaurbAuthor Commented:
Just a quick question. What is wrong in my batch file?

ECHO Check whether AVG is installed
SET AVGPATH="%ProgramFiles%\Grisoft\AVG Anti-Spyware 7.5"
SET UNINSTPATH="%ProgramFiles%\Grisoft\AVG Anti-Spyware 7.5\Uninstall.exe"
ECHO AVGPATH IS = %AVGPATH%
ECHO UNINSTPATH IS = %$UNINSTPATH%
IF NOT EXIST "%ProgramFiles%\Grisoft\AVG Anti-Spyware 7.5\Uninstall.exe" GOTO END
START /wait "%ProgramFiles%\Grisoft\AVG Anti-Spyware 7.5\Uninstall.exe /S"
ECHO Uninstall applet started
:END
ECHO AVG is not installed
0
 
VorenusCommented:
Why do you bother checking for the existence of the file ?
Simply run it and if it isn't here it isn't a big deal...
Or do you want to run some following actions only if the program was installed ?

Otherwise, start doesn't like too much spaces in file names so I suggest you use CD /D to first set the current directory and then run the command directly without the path.
0
 
ZaurbAuthor Commented:
OK! Thanks!
I've modified the script as follows:

ECHO Check whether AVG is installed
CD /d "%ProgramFiles%\Grisoft\AVG Anti-Spyware 7.5"
IF NOT EXIST Uninstall.exe GOTO END
START /wait Uninstall.exe /S
ECHO Uninstall applet started
:END
ECHO AVG is not installed

Works perfect! Thank you very much indeed!

0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

  • 9
  • 8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now