Forum Discussion
NAUK777
Jun 10, 2022Copper Contributor
Removing Dell Preinstall software
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 "...
Jun 10, 2022
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"}
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"}
- NAUK777Jun 14, 2022Copper Contributorthanks but i not sure what you mean
- Jun 14, 2022The 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"}- NAUK777Jun 20, 2022Copper Contributor
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
ā
- LainRobertsonJun 10, 2022Silver Contributor
Splitting will work. You might also be able to "cheese" it through using Invoke-Expression.
For example:
Invoke-Expression -Command '& $($unins.UninstallString)';
Cheers,
Lain