【问题标题】:remove dell optimizer service - powershell删除戴尔优化器服务 - powershell
【发布时间】:2022-10-15 02:46:22
【问题描述】:

问题 - 无法卸载戴尔优化器服务

长版—— 我正在寻找编写一个非常基本的脚本来删除戴尔优化器。当它完全安装并运行 get-package 时,我得到以下信息。 当通过管道将其卸载到卸载包时。我们还剩下戴尔优化器服务。 这也是在停止服务之后。

PS C:\WINDOWS\system32> Get-Package -Name *optimizer*

Name                           Version          Source                           ProviderName                               
----                           -------          ------                           ------------                               
Dell Optimizer                 2.0.651.0        C:\Program Files\Dell\DellOpt... msi                                        
DellOptimizerUI                2.0.651.0        C:\Program Files (x86)\Dell\D... msi                                        
Dell Optimizer Service         2.0.651.0                                         Programs   

dell optimizer service in programs and features
运行时的卸载字符串如下所示 -remove 或 -runfromtemp HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall
"C:\Program Files (x86)\InstallShield 安装信息{286A9ADE-A581-43E8-AA85-6F5D58C7DC88}\DellOptimizer.exe" -remove -runfromtemp

+ ... A9ADE-A581-43E8-AA85-6F5D58C7DC88}\DellOptimizer.exe" -remove -runfro ...
+                                                           ~~~~~~~
Unexpected token '-remove' in expression or statement.
At line:1 char:199
+ ... -A581-43E8-AA85-6F5D58C7DC88}\DellOptimizer.exe" -remove -runfromtemp
+                                                              ~~~~~~~~~~~~
Unexpected token '-runfromtemp' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken

exe位于

C:\Program Files (x86)\InstallShield 安装信息{286A9ADE-A581-43E8-AA85-6F5D58C7DC88}\DellOptimizer.exe

我已经用7zip解包了.exe,看看是否有卸载文件,但无济于事。

我相信它与它的providername 是程序有关,并且当您在ciminstance 中搜索以下内容时,戴尔优化器服务也不会出现。 我不确定如何找到它会属于哪个 CIMclass,因为它可能是朝着正确方向迈出的一步

PS C:\WINDOWS\system32> Get-CimInstance -ClassName Win32_Product | Sort-Object

有没有人做过这样的事情?或者我可以尝试什么?

【问题讨论】:

  • 引用的内容必须以不同的方式运行,例如调用运算符:& 'C:\Program Files (x86)\InstallShield Installation Information{286A9ADE-A581-43E8-AA85-6F5D58C7DC88}\DellOptimizer.exe' -remove -runfromtemp

标签: powershell uninstallation


【解决方案1】:

我解决了。这是一个愚蠢的错误,需要在命令提示符下运行卸载字符串

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



#Get Dell Optimizer from registry
$uninstallstring = get-itemproperty 'HKLM:SoftwareWow6432NodeMicrosoftWindowsCurrentVersionUninstall*' | Where-Object { $_.DisplayName -match "optimizer service"}



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



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

【讨论】:

    【解决方案2】:

    修复您的脚本

    #stop 戴尔优化器服务 获取服务-名称“DellOptimizer”|停止服务

    #从注册表获取戴尔优化器 $uninstallstring = get-itemproperty 'HKLM:SoftwareWow6432NodeMicrosoftWindowsCurrentVersionUninstall*' | Where-Object { $_.DisplayName -match "优化服务"}

    #获取戴尔优化器的卸载字符串 $uninstallstring = $uninstallstring.UninstallString

    #添加silent参数并通过cmd运行卸载 cmd /c $uninstallstring -silent

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-12-05
      • 1970-01-01
      • 2018-09-15
      • 2011-01-20
      • 2012-09-19
      • 1970-01-01
      • 1970-01-01
      • 2016-12-07
      相关资源
      最近更新 更多