Hi, Below is the action script which we are using…
Using BESRemove.exe
prefetch BESRemove.exe sha1:a92a1e012f8ddeac96c49c561d80960bced4ce82 size:2609936 http://software.bigfix.com/download/bes/95/util/BESRemove9.5.4.38.exe sha256:74ea7a28aae16fdb64bfbe370ee04bd147c6c18a755ce68032dbf656a3d68a89
// create a batch file to create the temp folder
delete __appendfile
delete tempdir.bat
appendfile @echo off
appendfile {if (exists variable “temp” of environment) then ("") else if (exists folder “temp” of windows folder) then ("") else ("mkdir " & pathname of windows folder as string & “\temp”)}
move __appendfile tempdir.bat
wait “{pathname of client folder of site “BESSupport” & “\RunQuiet.exe”}” tempdir.bat
delete tempdir.bat
delete “{if (exists variable “temp” of environment) then (value of variable “temp” of environment as string & “\BESRemove.exe”) else (pathname of folder “temp” of windows folder as string & “\BESRemove.exe”)}”
delete “{if (exists variable “temp” of environment) then (value of variable “temp” of environment as string & “\RunQuiet.exe”) else (pathname of folder “temp” of windows folder as string & “\RunQuiet.exe”)}”
delete “{if (exists variable “temp” of environment) then (value of variable “temp” of environment as string & “\delClient.iss”) else (pathname of folder “temp” of windows folder as string & “\delClient.iss”)}”
move “__download/BESRemove.exe” “{if (exists variable “temp” of environment) then (value of variable “temp” of environment as string & “\BESRemove.exe”) else (pathname of folder “temp” of windows folder as string & “\BESRemove.exe”)}”
copy “{pathname of client folder of site “BESSupport” & “\RunQuiet.exe”}” “{if (exists variable “temp” of environment) then (value of variable “temp” of environment as string & “\RunQuiet.exe”) else (pathname of folder “temp” of windows folder as string & “\RunQuiet.exe”)}”
copy “{pathname of client folder of site “BESSupport” & “\delClient.iss”}” “{if (exists variable “temp” of environment) then (value of variable “temp” of environment as string & “\delClient.iss”) else (pathname of folder “temp” of windows folder as string & “\delClient.iss”)}”
// create a batch file to uninstall client and run BESRemove from a different directory
appendfile @echo off
appendfile cd {if (exists variable “temp” of environment) then (value of variable “temp” of environment as string) else (pathname of folder “temp” of windows folder as string)}
appendfile {(if it ends with “%00” then preceding text of first “%00” of it else it) of (value “UninstallString” of key whose ((it = “IBM BigFix Client” OR it = “IBM Endpoint Manager Client” OR it = “BigFix Enterprise Client” OR it = “BigFix for IBM Proventia ESC Client” OR it = “ESP Agent” OR it = “Trend Micro Endpoint Security Platform” OR it = “Tivoli Endpoint Manager Client”) of (value “DisplayName” of it as string)) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry as string)} {if (value “UninstallString” of key whose ((it = “IBM BigFix Client” OR it = “IBM Endpoint Manager Client” OR it = “BigFix Enterprise Client” OR it = “BigFix for IBM Proventia ESC Client” OR it = “ESP Agent” OR it = “Trend Micro Endpoint Security Platform” OR it = “Tivoli Endpoint Manager Client”) of (value “DisplayName” of it as string)) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry as string as lowercase starts with “msiexec”) then “/qn” else ("/s --uninstallsilent " & (if version of regapp “BESClient.exe” < “5.1” then " /f1 %22" & (if (exists variable “temp” of environment) then (value of variable “temp” of environment as string & “\delClient.iss”) else (pathname of folder “temp” of windows folder as string & “\delClient.iss”)) & “%22” else “”))}
appendfile RunQuiet.exe BESRemove.exe /silent /force /client
appendfile rmdir /s /q “{pathname of parent folder of client}” > NUL 2> NUL
// move batch file to temp directory
delete “{if (exists variable “temp” of environment) then (value of variable “temp” of environment as string & “\RunBESRemove.bat”) else (pathname of folder “temp” of windows folder as string & “\RunBESRemove.bat”)}”
copy “__appendfile” “{if (exists variable “temp” of environment) then (value of variable “temp” of environment as string & “\RunBESRemove.bat”) else (pathname of folder “temp” of windows folder as string & “\RunBESRemove.bat”)}”
// run batchfile
run “{if (exists variable “temp” of environment) then (value of variable “temp” of environment as string & “\RunQuiet.exe”) else (pathname of folder “temp” of windows folder as string & “\RunQuiet.exe”)}” “{if (exists variable “temp” of environment) then (value of variable “temp” of environment as string & “\RunBESRemove.bat”) else (pathname of folder “temp” of windows folder as string & “\RunBESRemove.bat”)}”
Using Uninstallation registry string:
run cmd /c “MsiExec.exe /qn /X {{53744C0B-332F-4BAF-86F6-9745593FC1E2}”