Kill running application - firefox

(imported topic written by cstoneba)

Close but not quite working. The taskkill will work as a standalone, but it is not working within the if then command.

// kill the firefox application if it is running

If (exists running application whose (name of it as lowercase is "firefox.exe)) then (“runhidden taskkill /f /im firefox.exe”) else nothing

// uninstall firefox

runhidden “C:\Program Files\Mozilla Firefox\uninstall\helper.exe” /S

(imported comment written by jeremylam)

In actions, the if and other flow control commands are different from relevance. Here’s the format from the

Action Guide

:

if {EXPR1}
statements to execute on EXPR1 = TRUE
elseif {EXPR2}
statements to execute on EXPR1 != TRUE and EXPR2 = TRUE
else
statements to execute when EXPR1 != TRUE and EXPR2 != TRUE
endif

So your action would be

if {exists running application whose (name of it as lowercase is "firefox.exe)}
runhidden taskkill /f /im firefox.exe
endif
 
runhidden "C:\Program Files\Mozilla Firefox\uninstall\helper.exe" /S

(imported comment written by cstoneba)

That works. One final questions though, any idea why it is not accepting the /S at the end of the uninstaller? when I run the command “C:\Program Files\Mozilla Firefox\uninstall\helper.exe” /S from the command prompt, it works, but not through the fixlet.

(imported comment written by cstoneba)

nevermind, I got it to work using the command

runhidden {pathname of parent folder of regapp “firefox.exe”}\uninstall\helper.exe /s

(imported comment written by jessewk)

Try using waithidden.

Also, you probably need quotes around your paths:

waithidden “{pathname of parent folder of regapp “firefox.exe”}\uninstall\helper.exe” /s

(imported comment written by cstoneba)

After a few tweeks, this is what I have:

// uninstall firefox if firefox.exe is not running.

If {not exists running application whose (name of it as lowercase is “firefox.exe”)}

runhidden “{pathname of parent folder of regapp “firefox.exe”}\uninstall\helper.exe” /s

endif

The problem now is that it is reporting back “Not Reported” when firefox.exe is running. I think I need an else statement in there to quit if firefox.exe is running.