Page 1 of 1

uninstall a program from the uninst.exe file

Published: May 10, 2023 - 6:17 PM
by adgm11
Hello,
I want to uninstall USBFix from all my computers.
The command `run(r'%programfiles%\usbfix\un-usbfix.exe')` does nothing.
Any ideas?

Re: Uninstalling a program from the uninst.exe file

Published: May 12, 2023 - 7:49 PM
by adgm11
I found a command that works

Code: Select all

def install():
    run(r'start "c:\program files (x86)\Usbfix\Un-usbfix.exe"')
But I'd like to be able to specify that the uninstallation should only occur if the un-usbfix file exists. Because if the program has already been uninstalled, I get an error message like "the specified path could not be found". Is there a command like "IF EXIST"?
THANKS

Re: Uninstalling a program from the uninst.exe file

Published: May 15, 2023 - 11:30 AM
by t.heroult
Good morning

You can simply use the command

Code: Select all

if isfile("Chemin_Du_Fichier"):