在 powershell 中静默卸载 teamviewer 不适用于无声争论,有人知道我做错了什么吗?

发布于 2025-01-20 08:17:36 字数 746 浏览 0 评论 0原文

我正在使用 Powershell 脚本通过 RMM 软件安装和卸载不同的程序。通常这些脚本运行没有问题,但我注意到 teamviewer 会卡住。我在本地尝试了以下卸载命令,发现 teamviewer 会给出提示,即使命令中的参数用于静默卸载。

Start-Process -Wait -FilePath "C:\Program Files\TeamViewer\uninstall.exe" -ArgumentList "/S" -PassThru

Start-Process -Wait -FilePath "C:\Program Files\TeamViewer\uninstall.exe" -Argument "/silent" -PassThru

Start-Process -Wait -FilePath "C:\Program Files\TeamViewer\uninstall.exe" -ArgumentList '/S','/v','/qn' -passthru

有谁知道我做错了什么或解决方法是什么或不同的解决方案? 我找到了这个解决方案: https://silentinstallhq.com/teamviewer-install-and-卸载-powershell/ 但这不是我想要的,我不想安装不同的程序只是为了能够默默地卸载 TeamViewer。

I am using Powershell scripts to install and uninstall different programs trough RMM software. Usually those scripts run without a problem but i noticed for teamviewer it gets stuck. I tried the following uninstall commands locally and found out teamviewer gives a prompt even though the arguments in the command are for a silent uninstall.

Start-Process -Wait -FilePath "C:\Program Files\TeamViewer\uninstall.exe" -ArgumentList "/S" -PassThru

Start-Process -Wait -FilePath "C:\Program Files\TeamViewer\uninstall.exe" -Argument "/silent" -PassThru

Start-Process -Wait -FilePath "C:\Program Files\TeamViewer\uninstall.exe" -ArgumentList '/S','/v','/qn' -passthru

Does anybody know what i am doing wrong or what a workaround can be or a different solution?
I found this solution: https://silentinstallhq.com/teamviewer-install-and-uninstall-powershell/
But that is not what i am looking for, i don't want to install a different program just to be able to uninstall TeamViewer silently.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

给不了的爱 2025-01-27 08:17:36

我也遇到了这个问题。令人惊讶的是,我从未发现它通过谷歌搜索得到解决,但我发现修复非常简单,而且它特定于 PowerShell。

net stop TeamViewer

c:\program files\TeamViewer\uninstall.exe `/S

注意:我喜欢旧的 CMD net stop 命令,因为如果我使用 PS stop-process -Name TeamViewer* 命令,TeamViewer 就会重新启动。
最重要的是,在 PowerShell 中,您需要使用 PS 转义字符 `(左上角的键,与 ~ 相同的键)对 / 开关进行转义。 S 也区分大小写。必须是大写。

I ran into this problem, too. Surprisingly, I never found it solved through google searches but I discovered the fix was quite easy, and it's specific to PowerShell.

net stop TeamViewer

c:\program files\TeamViewer\uninstall.exe `/S

Notes: I like the old CMD net stop command because TeamViewer would just restart if I use the PS stop-process -Name TeamViewer* command.
Most importantly, in PowerShell, you need to escape the / switch with the PS escape character ` (top-left key, same key as ~). The S is also case sensitive. Must be uppercase.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文