Question about unattended or silent uninstallation

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
MauricioDeAbreu
Posts: 43
Joined: 12 Dec 2021 06:45

Question about unattended or silent uninstallation

#1 Post by MauricioDeAbreu » 11 Nov 2024 03:00

Buenas días amigos.

Tengo una duda con respecto a la desinstalación de un programa desde un archivo Batch

La única forma en que puedo ejecutar la desinstalación del programa es mediante esta linea que extraje del UninstallString del editor de registro.

rundll32.exe dfshim.dll,ShArpMaintain ComponentesHarware.application, Culture=neutral, PublicKeyToken=b3fd472d4be1fc0f, processorArchitecture=msil

Pero no encuentro una manera de hacer que la desinstalación sea sin intervención del usuario, ya que al ejecutar la linea muestra la ventana de desinstalación pero pide la confirmación (aceptar).

Use el parámetro /S pero me da error, diciendo que el programa no se ha podido desinstalar.

Hay alguna forma de lograr que se realice la desinstalación sin que pida darle a aceptar ?

De antemano muchísimas gracias por el apoyo.
Last edited by MauricioDeAbreu on 11 Nov 2024 12:50, edited 1 time in total.

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Duda con desinstalación desatendida o silenciosa

#2 Post by Squashman » 11 Nov 2024 09:48

We do ask that all posts are in English on the forum. If you need language specific support I would suggest you post on StackOverFlow which has dedicated sites for several languages.

MauricioDeAbreu
Posts: 43
Joined: 12 Dec 2021 06:45

Re: Duda con desinstalación desatendida o silenciosa

#3 Post by MauricioDeAbreu » 11 Nov 2024 10:35

Sorry, the browser translates automatically, so I thought I was in Spanish. :roll:

Good morning friends

I have a question regarding the uninstallation of a program from a Batch file

The only way I can execute the uninstallation of the program is through this line that extrajects from the uninstallstring of the registration editor.

rundll32.exe dfshim.dll,ShArpMaintain ComponentesHarware.application, Culture=neutral, PublicKeyToken=b3fd472d4be1fc0f, processorArchitecture=msil

But I can not find a way to make the uninstallation it is without user intervention, since when executing the line it shows the uninstall window but asks for confirmation.

Use the / s parameter but it gives me error, saying that the program has not been uninstalled.

Is there any way to get the uninstallation without asking to accept?

Thank you very much for the support.

Aacini
Expert
Posts: 1914
Joined: 06 Dec 2011 22:15
Location: México City, México
Contact:

Re: Duda con desinstalación desatendida o silenciosa

#4 Post by Aacini » 11 Nov 2024 11:28

You have not indicated the way to provide the confirmation... If it is just the Enter key, try:

Code: Select all

echo/| rundll32.exe dfshim.dll,ShArpMaintain ComponentesHarware.application, Culture=neutral, PublicKeyToken=b3fd472d4be1fc0f, processorArchitecture=msil
If it is a "S" key, try:

Code: Select all

echo S| rundll32.exe dfshim.dll,ShArpMaintain ComponentesHarware.application, Culture=neutral, PublicKeyToken=b3fd472d4be1fc0f, processorArchitecture=msil
If this don't works there are still other options...

Antonio

MauricioDeAbreu
Posts: 43
Joined: 12 Dec 2021 06:45

Re: Duda con desinstalación desatendida o silenciosa

#5 Post by MauricioDeAbreu » 11 Nov 2024 12:47

Thanks for replying.

It is accepted with the ENTER key.

and no, unfortunately it didn't work...

Thank you in advance for any other suggestion.

Aacini
Expert
Posts: 1914
Joined: 06 Dec 2011 22:15
Location: México City, México
Contact:

Re: Question about unattended or silent uninstallation

#6 Post by Aacini » 13 Nov 2024 04:11

Try this:

Code: Select all

@if (@CodeSection == @Batch) @then


@echo off

rem Use %SendKeys% to send keys to the keyboard buffer
set SendKeys=CScript //nologo //E:JScript "%~F0"

rem Start the other program in the same Window
start "" /B rundll32.exe dfshim.dll,ShArpMaintain ComponentesHarware.application, Culture=neutral, PublicKeyToken=b3fd472d4be1fc0f, processorArchitecture=msil

rem Enable next line if there are synchro problems
REM ping -n 4 localhost > NUL

rem Send the ENTER key
%SendKeys% "{ENTER}"

goto :EOF


@end


// JScript section

var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.SendKeys(WScript.Arguments(0));
Further details at this answer

Post Reply