TeamViewer QuickSupport removal
-
TeamViewer QuickSupport is a portable app that cannot be supported for patching.
As portable applications do not install, there is no automatic process to delete them, unlike traditional applications that have registry information and provide a silent uninstallString, therefore, portable applications can only be deleted and not uninstalled.
This script removes TeamViewer QuickSupport.
It should be noted that deleting files in the SYSTEM context recursively into areas controlled by users is considered bad practice, we have tried to compensate for this by checking if the file is a symbolic link, before removing it.# Define the paths to search and the file names to delete $rootPath = "C:\" $filesToDelete = @("TeamViewerQS.exe", "TeamViewerQS_x64.exe") # Function to safely delete files without following symlinks function Remove-File { param ( [string]$Path, [string[]]$Files ) # Get all directories and files in the specified path $items = Get-ChildItem -Path $Path -Recurse -Force -ErrorAction SilentlyContinue foreach ($item in $items) { # Skip if the item is a symlink if ($item.Attributes -band [System.IO.FileAttributes]::ReparsePoint) { Write-Output "Skipping symlink: $($item.FullName)" continue } # Check if the item is one of the files to delete if ($Files -contains $item.Name) { try { Remove-Item -Path $item.FullName -Force -ErrorAction Stop Write-Output "Deleted: $($item.FullName)" } catch { Write-Error "Failed to delete: $($item.FullName) - $_" } } } } # Call the function to remove the files Remove-File -Path $rootPath -Files $filesToDelete
Custom Software Configuration:
-