Overview
This article explains how to uninstall the Code42 agent from your computer. This article applies to the backup agent and legacy agent only. For the insider risk agent, see Uninstall the insider risk agent from user devices.
Uninstalling the Code42 agent removes the log files associated with your backups on this computer. If you're uninstalling as part of a troubleshooting process, send your log files to our Technical Support Engineers before uninstalling.
On April 10, 2024, the Code42 legacy agent reached end-of-life. Devices with the legacy agent are no longer backing up, and Incydr monitoring has stopped. Follow the steps in this article to uninstall the legacy agent from any devices that have not upgraded yet, then follow these steps to deploy both the insider risk and backup agents.
Standard uninstall
A standard uninstall removes the Code42 agent from your computer. An identity file is left on your computer in case you reinstall in the future.
Windows
Mac
Linux
Complete uninstall
A complete uninstall removes the Code42 agent, your computer's identity file, and any backups on your computer. Only perform a complete uninstall if:
- You want to permanently end all Code42 agent backups for this computer.
- A Technical Support Engineer instructs you to do so.
To completely uninstall the Code42 agent:
- Follow the instructions above for a standard uninstall.
- Delete the following folder from your computer:
Manual uninstall for Mac
Perform the following steps if you were unable to uninstall the Code42 agent on a Mac using the directions provided above.
A manual uninstall is typically not needed on Windows or Linux. However, if you already tried to remove the Code42 agent on a Mac by a non-standard method, the normal uninstall process will error out if subsequently run. This is because the installation file is locked on a Mac and it must be unlocked (with a chflags noschg
command) before it can be uninstalled.
You should only perform these manual uninstall steps under the supervision of a Technical Support Engineer. If run improperly, the commands have the potential to cause harm to your system.
Some versions of macOS Ventura may require you to grant additional permissions to the application you use to uninstall the agent (for example, Terminal). To add permissions:
- Go to System Settings > Privacy & Security > App Management.
- Click the plus + icon.
- Select the application you're using to perform the uninstall (for example, Terminal).
- After completing the uninstall steps below, you can remove this permission.
Installed for all users
- Run the following command in Terminal:
sudo ls
- Enter the administrator password for the computer and press Return.
- Copy and paste the following commands.
sudo launchctl unload /Library/LaunchDaemons/com.code42.service.plist
sudo chflags noschg /Applications/Code42.app
sudo chmod -R 755 "/Library/Application Support/CrashPlan/"
- Open a Finder window and delete the following folders:
/Library/LaunchDaemons/com.code42.service.plist
/Applications/Code42/
/Library/Caches/CrashPlan/
/Library/Application Support/CrashPlan/
Installed per user
- Run the following command in Terminal:
sudo ls
- Enter the administrator password for the computer and press Return.
- Copy and paste the following commands. The "
~
" symbol designates the user folder.sudo launchctl unload/ ~/Library/LaunchAgents/com.code42.service.plist
sudo chflags noschg ~/Applications/Code42.app
sudo chmod -R 755 "~/Library/Application Support/CrashPlan/"
- Open a Finder window and delete the following folder: ~/Library/Application Support/CrashPlan/
Scripted uninstall for Mac and Windows
To perform an automated manual uninstall on Mac or Windows via script, use the following example scripts provided by our Professional Services team.
You should only use these uninstall scripts under the supervision of a Technical Support Engineer. If run improperly, the scripts have the potential to cause harm to your system.
Mac
Professional Services filename: mac_uninstall.sh
# The section below uninstalls Code42, if it is installed on the system. if [[ -e /Library/Application\ Support/CrashPlan/ ]]; then launchctl unload /Library/LaunchDaemons/com.crashplan.engine.plist launchctl unload /Library/LaunchDaemons/com.code42.service.plist /Library/Application\ Support/CrashPlan/uninstall.sh --preserve-data-upgrade # versions prior to 12.2.0 will need the below line un-commented # /Applications/Code42.app/Contents/Helpers/Uninstall.app/Contents/Resources/uninstall.sh --preserve-data-upgrade fi # The section below removes the Code42 identity file. Uncomment the lines below if you wish to do a complete uninstall. # rm -r /Library/Application\ Support/CrashPlan/
Windows
Windows Powershell Script - Full Removal and Cleanup
Professional Services filename: EAv02_backup_agent_cleanup_code42_windows.ps1
This is a complete removal tool for Code42 Backup and Legacy, it will check for both Pre User and For Everyone installs and removes all .identity files and folder locations
Flag `dontLog` is set to false by default and will log out to C:\ProgramData\
#EAv02_backup_agent_cleanup_code42_windows.ps1 #Script for the removal of the Code42 Backup or Legacy Agents #Removes up all Installs (For Everyone and Per User), Identities, Logs and Folders for Code42 Backup or Legacy Agents #Last Updated 2024-10-18 #This work is licensed under the terms of the MIT license. #For a copy, see <https://opensource.org/licenses/MIT>. #Scripts are provided "As Is" #~~~~~~~~~~~~~~~~~ #Setup Run Flags #Set $dontLog to True to remove the on Disk log out of the Code42 removal script $dontLog=$false #====================================================================================== #~~~~~~~~~~~~~~~~~ #No Edits or Input fields after this line #~~~~~~~~~~~~~~~~~ #====================================================================================== #Logging Setup $logfiledate = Get-Date -format "dd-MM-yyyy-HH-mm-ss" $PROC_LOG = "C:\ProgramData\EAv02_backup_agent_cleanup_code42_windows_$logfiledate.log" function Write-Log { [CmdletBinding()] Param ( [Parameter(Mandatory=$true, Position=0)] [string]$LogMessage ) Add-Content -Path $PROC_LOG -Value (Write-Output ("{0} - {1}" -f (Get-Date), $LogMessage)) write-host $LogMessage } #Script must be run as an administrator. This will make the script exit if it is not. if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { $wshell = New-Object -ComObject Wscript.Shell $wshell.Popup("Not running as administrator!",0,"Code42 pre-Install",0x1) Write-Log "Not running as administrator!, closing script." exit } Write-Log "##########################################################" Write-Log "Running EAv02_backup_agent_cleanup_code42_windows.ps1" Write-Log "dontLog is set to ($dontLog)" Write-Log "Last updated at Oct-18-2024" Write-Log "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" #~~~~~~~~~~~~~~~~~ #Checking for if Uninstalling is needed #~~~~~~~~~~~~~~~~~ #Test for all Per User and For Everyone Legacy or Backup Agent installs. $previousBackup=$false get-childItem C:\Users | forEach $path { Write-Log "Checking for Backup/Legacy install at C:\Users\$_\AppData\(Local or Roaming)\CrashPlan" if (((Test-path C:\Users\$_\AppData\Local\Programs\Code42) -or (Test-path C:\Users\$_\AppData\Roaming\Programs\Code42)) -or (Test-path "C:\Program Files\Code42\")) { Write-Log "Found a install at ($_) level Code42 Backup or Legacy Agent install." $code42_process = get-Process | Where-Object {$_.Name -Match 'Code42Service'} $crashplan_process = get-Process | Where-Object {$_.Name -Match 'CrashPlan'} Write-Log "crashplan_process is ($crashplan_process)" Write-Log "code42_process is ($code42_process)" if (-not ([string]::IsNullOrEmpty($code42_process))) { Stop-process $code42_process -Force Write-Log "Stopped Code42 Process/Service" } elseif (-not ([string]::IsNullOrEmpty($crashplan_process))) { Stop-process $crashplan_process -Force Write-Log "Stopped CrashPlan Process/Service" } [array]$prodId = (Get-CIMInstance -Class Win32_Product | Where-Object {$_.Name -Match 'CrashPlan' -or $_.Name -eq 'Code42'}).IdentifyingNumber Write-Log "prodId returned ($prodId)" if (-not ([string]::IsNullOrEmpty($prodId))) { $prodIdarraycount=$prodId.count Write-Log "prodIdarraycount ($prodIdarraycount)" for ($i=0; $i -lt $prodIdarraycount; $i++) { $prodIdworking=$prodId[$i].Trim() Write-Log "Uninstalling ($prodIdworking)" Start-Process "msiexec.exe" -Wait -ArgumentList "/X '$prodIdworking' /norestart /qn" Write-Log "Sleep for 10 for msiexec.exe to finish" sleep 10 Write-Log "Uninstall of Code42 Backup or Legacy Agent ($prodIdworking) Done" } $previousBackup=$true } } } if ($previousBackup -eq $false) { Write-Log "No Install of Backup or Legacy Agent Found" } Write-Log "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" #Test if the .identity is present and if it needs to be removed, This is independent of uninstalling the client as there can be an old file $previousIdentity=$false if (Test-path C:\ProgramData\CrashPlan\.identity){ Remove-Item C:\ProgramData\CrashPlan\ -Recurse -Force -ErrorAction SilentlyContinue Write-Log "Removed System Level .identity file at C:\ProgramData\CrashPlan\.identity" $previousIdentity=$true } get-childItem C:\Users | forEach $path { Write-Log "Checking for Per User .identity in ($_)" if ((Test-path C:\Users\$_\AppData\Local\CrashPlan\.identity) -or (Test-path C:\Users\$_\AppData\Roaming\CrashPlan\.identity)){ if (Test-path C:\Users\$_\AppData\Local\CrashPlan\.identity){ Remove-Item -Path C:\Users\$_\AppData\Local\CrashPlan\ -Recurse -Force -ErrorAction SilentlyContinue } if (Test-path C:\Users\$_\AppData\Roaming\CrashPlan\.identity){ Remove-Item -Path C:\Users\$_\AppData\Roaming\CrashPlan\ -Recurse -Force -ErrorAction SilentlyContinue } Write-Log "Removed $_ .identity file" $previousIdentity=$true } } if ($previousIdentity -eq $false) { Write-Log "No Identity File for Backup or Legacy Agent Found" } Write-Log "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" Write-Log "Checking for leftover Code42/CrashPlan Folders" #checking if any folders are still existing and removing if so if (Test-path C:\ProgramData\CrashPlan\){ Remove-Item C:\ProgramData\CrashPlan\ -Recurse -Force -ErrorAction SilentlyContinue Write-Log "Removed C:\ProgramData\CrashPlan\" } if (Test-path "C:\Program Files\Code42\"){ Remove-Item "C:\Program Files\Code42\" -Recurse -Force -ErrorAction SilentlyContinue Write-Log "Removed C:\Program Files\Code42\" } get-childItem C:\Users | forEach $path { if (Test-path C:\Users\$_\AppData\Local\CrashPlan\){ Remove-Item -Path C:\Users\$_\AppData\Local\CrashPlan\ -Recurse -Force -ErrorAction SilentlyContinue Write-Log "Removed C:\Users\$_\AppData\Local\CrashPlan\" } if (Test-path C:\Users\$_\AppData\Roaming\CrashPlan\){ Remove-Item -Path C:\Users\$_\AppData\Roaming\CrashPlan\ -Recurse -Force -ErrorAction SilentlyContinue Write-Log "Removed C:\Users\$_\AppData\Roaming\CrashPlan\" } if (Test-path C:\Users\$_\AppData\Local\Programs\Code42\){ Remove-Item -Path C:\Users\$_\AppData\Local\Programs\Code42\ -Recurse -Force -ErrorAction SilentlyContinue Write-Log "Removed C:\Users\$_\AppData\Local\Programs\Code42\" } } Write-Log "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" Write-Log "Script Finished, Closing Down" Write-Log "##########################################################" if ($dontLog) {Remove-Item -Path C:\ProgramData\EAv02_backup_agent_cleanup_code42_windows* -Recurse -Force -ErrorAction SilentlyContinue } else {Write-Log "Removal Log is at C:\ProgramData\EAv02_backup_agent_cleanup_code42_windows_$logfiledate.log"} Exit 0
Windows Management Instrumentation (WMI) script
Professional Services filename: win_uninstall_WMI.ps1
# The section below uninstalls Code42, if it is installed on the system. Stop-Service -Name "CrashPlanService" Stop-Service -Name "Code42Service" $PRODID = (Get-CIMInstance -Class Win32_Product | Where-Object {$_.Name -Match 'CrashPlan'}).IdentifyingNumber Start-Process "msiexec.exe" -Wait -ArgumentList "/X $PRODID /norestart /qn" $PRODID = (Get-CIMInstance -Class Win32_Product | Where-Object {$_.Name -Match 'Code42$'}).IdentifyingNumber Start-Process "msiexec.exe" -Wait -ArgumentList "/X $PRODID /norestart /qn" # The section below removes the Code42 identity file. Uncomment the lines below if you wish to do a complete uninstall. # Remove-Item -Path "C:\ProgramData\CrashPlan" -Recurse -Force
Windows Management Instrumentation Command-Line (WMIC) script
Professional Services filename: win_uninstall_wmic.bat
@ECHO off REM The section below uninstalls Code42, if it is installed on the system. sc stop CrashPlanService sc stop Code42Service waitfor NEVERSIGNAL /t 20 2 NUL FOR /f "tokens=1" %%I IN ('WMIC product get IdentifyingNumber^, Name ^| findstr CrashPlan') DO start /wait msiexec /x %%I /q /norestart FOR /f "tokens=1" %%I IN ('WMIC product get IdentifyingNumber^, Name ^| findstr Code42 ^| findstr /v AAT') DO start /wait msiexec /x %%I /q /norestart REM The section below removes the Code42 identity file. Uncomment the lines below if you wish to do a complete uninstall. REM rd /s /q C:\ProgramData\CrashPlan exit
Windows Command Prompt one-line batch command
cmd /c start /wait powershell.exe "(Get-WmiObject Win32_Product | where {$_.Name -eq 'Code42'}).IdentifyingNumber | ForEach-Object{(Start-Process msiexec.exe -ArgumentList \"/qnr /x $_\" -verb runas -Wait -PassThru)}; Remove-Item -Path "C:\ProgramData\CrashPlan" -Recurse -Force"