Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Credit to Reddit user piepsodj - https://www.reddit.com/r/msp/comments/125sxuo/comment/je6kugc/
- #This section will kill the 3CXDesktopApp process, if it is currently running....
- if (Get-Process -Name "3CXDesktopApp" -ErrorAction SilentlyContinue) {
- write-host "Found the process running, killing it!"
- Stop-Process -Name "3CXDesktopApp" -Force
- }
- #This section will delete all 3CXDesktopApp folders from the user profile directories and program files directories.
- $ListOfLocations = @(
- "C:\Users\*\AppData\Local\Programs\3CXDesktopApp",
- "C:\Program Files\3CXDesktopApp"
- )
- foreach ($Location in $ListOfLocations){
- write-host "Searching for 3CX Desktop App folders at '$Location'..."
- $FoundInstances = Get-Item -Path $Location -Directory -ErrorAction SilentlyContinue
- foreach ($FoundInstance in $FoundInstances){
- write-host "Found 3CX Desktop App Folder at '$FoundInstance', deleting it..."
- Remove-Item -Path $FoundInstance.FullName -Recurse -Force
- }
- }
- #This section will create a file called "3cxremoved.txt" in the root of the C:\ drive.
- $FilePath = "C:\3cxremoved.txt"
- $Content = "3CX Desktop App has been removed from this computer."
- New-Item -Path $FilePath -ItemType File -Force
- Set-Content -Path $FilePath -Value $Content
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement