Removing Dell Preinstall software

Copper Contributor

Hi there,

I been removing the following Dell application from a laptop:  with the following powershell comands, its not pretty but it works for me.  

The first 3 commands work 

Get-Package -Name "*Dell Command*" | Uninstall-Package
Get-Package -Name "*Dell Power Manager Service*" | Uninstall-Package
Get-Package -Name "*Dell Digital Delivery Services*" | Uninstall-Package

 

I had to use another script I found to remove:  Dell SupportAssist Remediation this worked it move the different varations  of support assist.

 

$SAVer = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall |

Get-ItemProperty |

Where-Object {$_.DisplayName -match "SupportAssist" } |

Where-Object {$_.DisplayVersion -notlike "3.2*"} |

Select-Object -Property DisplayVersion, UninstallString, PSChildName

 

ForEach ($ver in $SAVer) {

 

If ($ver.UninstallString) {

 

$uninst = $ver.UninstallString

& cmd /c $uninst /quiet /norestart

 

}

}

 

 

I cannot remove Dell Optimizer

 

I have tried the following: 

 

Get-Package -Name "*Dell Optimizer*" | Uninstall-Package  nothing happens

Next I tried to remove from the registry. with the following PowerShell lines 

$unins = Get-ChildItem "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall" -ErrorAction SilentlyContinue | Get-ItemProperty | Where-Object {$_.DisplayName -Like "*Dell Optimizer *"} | Select Displayname, Uninstallstring

 

I check to verify the uninstall string or path 

 

NAUK777_0-1654859247671.png

 

I then run the following line Start-Process -FilePath $unins.UninstallString -ArgumentList "/S" -Wait  and the the error message.  

 

NAUK777_1-1654859460511.png

 

 

when i display the uninstall string i get this but in not sure what this mean or if its related

I new to powershell so I find scripts that work but i cannot find a command for this one app

 


DisplayName UninstallString
----------- ---------------
Dell Optimizer Service "C:\Program Files (x86)\InstallShield Installation Information\{286A9ADE-A581-43E8-AA85-6F5D58C7DC88}\DellOptimizer.exe" -remove -runfromtemp

 

 

any help of advise would be great whilst we wait for our imaging server i have to build 40 laptops many

 

 

 

 

 

10 Replies
I think you have to split it into a path , "C:\Program Files (x86)\InstallShield Installation Information\{286A9ADE-A581-43E8-AA85-6F5D58C7DC88}\DellOptimizer.exe" in this case, and the argumentlist which is -remove -runfromtemp . It now wants to use "C:\Program Files (x86)\InstallShield Installation Information\{286A9ADE-A581-43E8-AA85-6F5D58C7DC88}\DellOptimizer.exe" -remove -runfromtemp as uninstallstring.

You could do a simple
if (test-path -path "C:\Program Files (x86)\InstallShield Installation Information\{286A9ADE-A581-43E8-AA85-6F5D58C7DC88}\DellOptimizer.exe" ) {invoke-command -scriptblock {'C:\Program Files (x86)\InstallShield Installation Information\{286A9ADE-A581-43E8-AA85-6F5D58C7DC88}\DellOptimizer.exe'} -ArgumentList "-remove -runfromtemp"}

@Harm_Veenstra @NAUK777 

 

Splitting will work. You might also be able to "cheese" it through using Invoke-Expression.

 

For example:

Invoke-Expression -Command '& $($unins.UninstallString)';

 

Cheers,

Lain

thanks but i not sure what you mean
The uninstall string contains the path to the uninstall executable together with parameters, you try to run that together with a /s argumentlist...
My example script was for checking the existence of the software and then running the correct invoke-command with the uninstall executable and parameters in the argumentlist.

if (test-path -path "C:\Program Files (x86)\InstallShield Installation Information\{286A9ADE-A581-43E8-AA85-6F5D58C7DC88}\DellOptimizer.exe" ) {invoke-command -scriptblock {'C:\Program Files (x86)\InstallShield Installation Information\{286A9ADE-A581-43E8-AA85-6F5D58C7DC88}\DellOptimizer.exe'} -ArgumentList "-remove -runfromtemp"}

@Harm_Veenstra 

I tried the script and first i got an error message i then removed the if from the beginning of the script and it just mirrored the scripts 

script error for dell optimzer.PNG

if (test-path -path "C:\Program Files (x86)\InstallShield Installation Information\{286A9ADE-A581-43E8-AA85-6F5D58C7DC88}\DellOptimizer.exe" ) {
invoke-command -scriptblock {'C:\Program Files (x86)\InstallShield Installation Information\{286A9ADE-A581-43E8-AA85-6F5D58C7DC88}\DellOptimizer.exe'} -ArgumentList '-remove -runfromtemp'
}

Strange, the -argumentlist is a valid parameter for invoke-command?

@Harm_Veenstra 

 

I think I will just have to remove it manually but I do appreciate your help with this.

 

thanks 

invoke-command -scriptblock {'C:\Program Files (x86)\InstallShield Installation Information\{286A9ADE-A581-43E8-AA85-6F5D58C7DC88}\DellOptimizer.exe'} -ArgumentList '-remove -runfromtemp'
}
You can always put this in the script that you use for other packages, if it's not there then you will receive an error but it should uninstall it when present

@Harm_Veenstra 

 

 Thank you Harm, 

I just concious of the time you spending trying to help which is appreciated but I sure do not want to take advantage has time is import to us all.  I will give the script a go but will also try it on other software like you mentioned.

 

regard Nick 

 

@NAUK777 

 

try this

#detection

<#
Dell Optimizer Still Around
#>


try
{

$Folder = 'C:\Program Files\Dell\DellOptimizer\'
"Test to see if folder [$Folder] exists"
if (Test-Path -Path $Folder) {
"Path exists!"
Return $results.count
exit 1

} else {
"Path doesn't exist."
}
exit 0
}

catch{
$errMsg = $_.Exception.Message
Write-Error $errMsg
exit 1
}

#remediation
#Date and time
$dt = Get-Date -Format "dd-MM-yyyy-HH-mm-ss"

$logfile = "$env:temp\csi-delete-delloptimizer-$dt.log"
Start-Transcript -Path $logfile

#stop dell optimizer services
Get-Service -Name "DellOptimizer" | Stop-Service

#Get Dell Optimizer from registry
$uninstallstring = get-itemproperty 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' | Where-Object { $_.DisplayName -match "optimizer service"}

#get the uninstall string for dell optimizer
$uninstallstring = $uninstallstring.UninstallString

#add the silent parameter and run throguh cmd to uninstall
cmd /c $uninstallstring -silent

Stop-Transcript

regards,
THiago Beier