Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This script is used to REMOVE the presence of Clear, ClearBrowser, ClearBar, and OneLaunch on devices
- # Find Clearbar related processes and stop them
- $valid_clear_path = "C:\Users\*\AppData\Local\*"
- $process_names = @("Clear", "clearbrowser", "Clear.Remoting.Native", "chrome_proxy", "chrome_pwa_launcher", "elevation_service", "notification_helper")
- ForEach ($proc in $process_names) {
- $clear_processes = Get-Process | Where-Object { $_.Name -like $proc }
- if ($clear_processes.Count -eq 0) {
- Write-Output "No $proc processes were found."
- } else {
- Write-Output "The following processes contained Clear and file paths will be checked: $clear_processes"
- ForEach ($process in $clear_processes) {
- $path = $process.Path
- if ($path -like $valid_clear_path) {
- Stop-Process $process -Force -Confirm:$false
- Write-Output "$process.Name process file path matches and has been stopped."
- } else {
- Write-Output "$process.Name file path doesn't match and process was not stopped."
- }
- }
- }
- }
- Start-Sleep -Seconds 2
- # Find Clearbar related directories and deletes them
- $file_paths = @("\AppData\Local\Clear", "\AppData\Local\Clearbar", "\AppData\Local\ClearBrowser", "\AppData\Local\Programs\Clear", "\AppData\Local\Programs\Clearbar", "\AppData\Local\Temp\ClearBrowser_topsites", "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Clear.lnk", "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Clearbar.lnk", "\Desktop\Clear.lnk", "\Desktop\Clearbar.lnk")
- ForEach ($folder in (Get-ChildItem c:\Users)) {
- ForEach ($fpath in $file_paths){
- $path = $folder.pspath + $fpath
- if (Test-Path $path) {
- Remove-Item -Path $path -Recurse -Force -Confirm:$false -ErrorAction SilentlyContinue
- Write-Output "$path has been deleted."
- }
- }
- }
- # Find Clearbar related registry keys and removes them
- $reg_paths = @("\Software\Clearbar", "\Software\Clearbar.app", "\Software\ClearBrowser")
- ForEach ($registry_hive in (Get-ChildItem registry::hkey_users)) {
- ForEach ($regpath in $reg_paths) {
- $path = $registry_hive.pspath + $regpath
- if (Test-Path $path) {
- Remove-Item -Path $path -Recurse -Force -Confirm:$false -ErrorAction SilentlyContinue
- Write-Output "$path has been removed."
- }
- }
- }
- $reg_properties = @("Clearbar", "Clearbar.app", "ClearBrowser", "Clear")
- ForEach ($registry_hive in (Get-ChildItem registry::hkey_users)) {
- ForEach ($property in $reg_properties) {
- $path = $registry_hive.pspath + "\Software\Microsoft\Windows\CurrentVersion\Run"
- if (Test-Path $path) {
- $reg_key = Get-Item $path
- if ($reg_key.GetValue($property)) {
- Remove-ItemProperty $path $property -Force -Confirm:$false
- Write-Output "$path\$property registry property value has been removed."
- }
- }
- }
- }
- # Find Clearbar related scheduled tasks and unregister them
- $schtasknames = @("ClearStartAtLoginTask", "ClearbarStartAtLoginTask", "ClearUpdateChecker", "ClearbarUpdateChecker")
- $c = 0
- ForEach ($task in $schtasknames) {
- $clear_tasks = Get-ScheduledTask -TaskName $task -ErrorAction SilentlyContinue
- if ($clear_tasks) {
- $c++
- Unregister-ScheduledTask -TaskName $task -Confirm:$false
- Write-Output "Scheduled task '$task' has been removed."
- }
- }
- if ($c -eq 0) {
- Write-Output "No Clear scheduled tasks were found."
- }
- # Find OneLaunch related processes and stop them
- $valid_path = "C:\Users\*\AppData\Local\OneLaunch\*"
- $process_names = @("OneLaunch", "OneLaunchTray", "Chromium")
- ForEach ($proc in $process_names) {
- $OL_processes = Get-Process | Where-Object { $_.Name -like $proc }
- if ($OL_processes.Count -eq 0) {
- Write-Output "No $proc processes were found."
- } else {
- Write-Output "The following processes contained $proc and file paths will be checked: $OL_processes"
- ForEach ($process in $OL_processes) {
- $path = $process.Path
- if ($path -like $valid_path) {
- Stop-Process $process -Force -Confirm:$false
- Write-Output "$proc process file path matches and has been stopped."
- } else {
- Write-Output "$proc file path doesn't match and process was not stopped."
- }
- }
- }
- }
- Start-Sleep -Seconds 2
- # Find OneLaunch related directories and deletes them
- $file_paths = @("\AppData\Local\OneLaunch", "\Desktop\Onelaunch Software.exe", "\Desktop\Onelaunch Software.lnk", "\Desktop\OneLaunch.lnk", "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\OneLaunch.lnk", "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\OneLaunchUpdater.lnk", "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\OneLaunchChromium.lnk", "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneLaunch")
- ForEach ($folder in (Get-ChildItem C:\Users)) {
- ForEach ($fpath in $file_paths) {
- $path = $folder.pspath + $fpath
- if (Test-Path $path) {
- Remove-Item -Path $path -Recurse -Force -Confirm:$false -ErrorAction SilentlyContinue
- Write-Output "$path has been deleted."
- }
- }
- }
- # Find OneLaunch related registry keys and removes them
- $reg_paths = @("\Software\OneLaunch")
- ForEach ($registry_hive in (Get-ChildItem registry::hkey_users)) {
- ForEach ($regpath in $reg_paths) {
- $path = $registry_hive.pspath + $regpath
- if (Test-Path $path) {
- Remove-item -Path $path -Recurse -Force -Confirm:$false -ErrorAction SilentlyContinue
- Write-Output "$path has been removed."
- }
- }
- }
- $reg_properties = @("OneLaunch")
- ForEach ($registry_hive in (Get-ChildItem registry::hkey_users)) {
- ForEach ($property in $reg_properties) {
- $path = $registry_hive.pspath + "\Software\Microsoft\Windows\CurrentVersion\Run"
- if (Test-Path $path) {
- $reg_key = Get-Item $path
- if ($reg_key.GetValue($property)) {
- Remove-ItemProperty $path $property -Force -Confirm:$false
- Write-Output "$path\$property registry property value has been removed."
- }
- }
- }
- }
- # Find OneLaunch related scheduled tasks and unregister them
- $schtasknames = @("ChromiumLaunchTask", "OneLaunchLaunchTask")
- $c = 0
- ForEach ($task in $schtasknames) {
- $clear_tasks = Get-ScheduledTask -TaskName $task -ErrorAction SilentlyContinue
- if ($clear_tasks) {
- $c++
- Unregister-ScheduledTask -TaskName $task -Confirm:$false
- Write-Output "Scheduled task '$task' has been removed."
- }
- }
- if ($c -eq 0) {
- Write-Output "No OneLaunch scheduled tasks were found."
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement