Uninstall password protected AV

I am trying to uninstall AV and being difficult. I can run the uninstaller in dos which is simply
msiexec.exe /x {7911E943-32CC-45D0-A29C-56E6EF762275} KLLOGIN=username KLPASSWD=password /qn

the actual password has special characters such as p@sS#wRodr!

I tested following script in QNA debugger which reports as being OK however it fails with error code 1 in when I run in bigfix.

delete __appendfile
delete clearquiet.bat
appendfile @ECHO OFF
appendfile wait msiexec.exe /x {{7911E943-32CC-45D0-A29C-56E6EF762275} KLLOGIN=username KLPASSWD=password /qn
move __appendfile clearquiet.bat
waithidden clearquiet.bat
delete clearquiet.bat

I also tried the following which has not been successful and in QNA debuggers shows error as
Command failed (Substitution failed while writing file) createfile until end

// Log setup
parameter “mainSWDLogFolder” = "{parent folder of client folder of current site}/__Global/SWDDeployData"
folder create "{parameter “mainSWDLogFolder”}"
parameter “logFile” = “SWD_DeploymentResults.log”

//**End Preparation Marker
delete __createfile
parameter “logFolder” = “{parameter “mainSWDLogFolder”}”
// Run setup process
delete run.bat

// Use .bat to set working directory to packages root, for setup command.
createfile until end
cd "{parameter “baseFolder”}"
rem // See comments at the beginning of this action for an explanation of the comment markers.
echo %DATE% %TIME% >> "{parameter “logFolder”}{parameter “logFile”}"
echo Action ID: {id of active action} >> "{parameter “logFolder”}{parameter “logFile”}"
rem //**Begin Command Marker
echo Command: msiexec.exe /x {{7911E943-32CC-45D0-A29C-56E6EF762275} KLLOGIN=username KLPASSWD=password /qn >> "{parameter “logFolder”}{parameter “logFile”}"
set errorlevel=
msiexec.exe /x {{7911E943-32CC-45D0-A29C-56E6EF762275} KLLOGIN=username KLPASSWD=password /qn >> “{parameter “logFolder”}{parameter “logFile”}” 2>&1
set SWDExitCode=%errorlevel%
rem //**End Command Marker

echo Return code: %SWDExitCode% >> "{parameter “logFolder”}{parameter “logFile”}"
echo. >> "{parameter “logFolder”}{parameter “logFile”}"
exit %SWDExitCode%

move __createfile run.bat
// You will not be able to stop or take action on an applicable BigFix Client until your installer completes.
// So ensure no user input is required.
// If your package absolutely must interact with the user, replace ‘override wait’ with ‘override run’ and ‘wait’ with ‘run’.
override wait
wait run.bat

//**Begin Closing Marker
// Get the return code of the previous action.
parameter “returnCode” = “{exit code of action}”

// Task will now exit.
exit {parameter “returnCode”}
//**End Closing Marker

There may be other things that we’ll need to troubleshoot about this action, but the first thing I see is that you had the ActionScript command wait at the beginning of the msiexec command in your .bat. Since you’re building a .bat with appendfile, you don’t need to include wait. The contents of your .bat should be exactly what you’d run from the command line.

That said, you don’t necessarily have to make the .bat file. That’s where wait comes in. You could probably just make this a one-liner:

wait msiexec.exe /x {{7911E943-32CC-45D0-A29C-56E6EF762275} KLLOGIN=username KLPASSWD=password /qn
1 Like

Also consider the special characters in the password may be getting interpreted by the shell or by ActionScript itself.

First try enclosing the password in doublequote " characters. If it contains {, replace that with {{. If it contains & or |, try adding a ^ before it (the escape character for CMD shell).

Tried escape characters but no luck , very frustrating… I do not have any of the symbols within the password being either } or & or | - wander if bigfix admin control / systems might be able to offer anything ??

Maybe the uninstaller doesn’t work in 32-bit mode?

Try adding
action uses wow64 redirection false
Somewhere before the ‘wait’ command.

Otherwise, test interactively using psexec. Perhaps their uninstaller will present some useful message.

1 Like

1 - Temporarily remove the last line delete clearquiet.bat and run the action again. Visually inspect the .bat file in the client folders. Does it look correct?
2 - Try to run the .bat file with a double click and see if it works when run as your user or gives you any specific error messages.