It’s fairly simple to uninstall PuTTY. By default, it comes with a handy executable that you can use to remove it from your machine. But to silently uninstall PuTTY, you need to do some finagling.
Let’s talk about how to silently uninstall PuTTY. We'll cover three different ways to do this: with a PowerShell script, with PDQ Deploy & Inventory, and with PDQ Connect.
What is PuTTY?
PuTTY is an open-source program that you can use as a File Transfer Protocol (FTP). You can use PuTTY to remote into a machine via Secure Shell (SSH). (Or if security disgusts you, you can use Telnet.)
Some servers lack a graphical user interface (GUI), so you have to use the command line to connect. PuTTY enables you to do that.
How to uninstall PuTTY with PowerShell
If you prefer a manual approach to silent uninstalls, we’ve got you covered with PowerShell.
Easily run PowerShell scripts on remote devices
Need to run your awesome PowerShell scripts on remote devices? PDQ Connect can easily execute PowerShell scripts on any managed device with an active internet connection.
Here’s a handy script to find and remove PuTTY instances on your device(s).
function Stop-PuTTYProcess {
$puttyProcess = Get-Process -Name "putty" -ErrorAction SilentlyContinue
if ($puttyProcess) {
Write-Output "Stopping PuTTY process..."
Stop-Process -Name "putty" -Force
}
}
function Remove-PuTTY {
param (
[string]$path
)
$paths = "$env:ProgramFiles\PuTTY", "$env:ProgramFiles(x86)\PuTTY"
foreach ($path in $paths) {
if (Test-Path "$path\unins000.exe") {
Write-Output "Deleting $path\putty.exe..."
Remove-Item -Force "$path\putty.exe"
Write-Output "Uninstalling PuTTY EXE Found in $path ..."
Start-Process -FilePath "$path\unins000.exe" -ArgumentList "/SILENT" -Wait
} elseif (Test-Path "$path\putty.exe") {
Write-Output "Deleting $path\putty.exe..."
Remove-Item -Force "$path\putty.exe"
}
}
}
function Remove-PuttyMSI {
$AppName = "PuTTY"
#-------------------------------------------------------------------------------
Write-Output "Checking if there are any msi-based installations for $AppName..."
#-------------------------------------------------------------------------------
FOREACH ( $Architecture in "SOFTWARE", "SOFTWARE\Wow6432Node" )
{
$UninstallKeys = "HKLM:\$Architecture\Microsoft\Windows\CurrentVersion\Uninstall"
IF (Test-path $UninstallKeys) {
Write-Output "Checking for $AppName installation in $UninstallKeys"
$GUID = Get-ItemProperty -Path "$UninstallKeys\*" |
Where-Object -FilterScript { $_.DisplayName -like "$AppName*" } |
Select-Object PSChildName -ExpandProperty PSChildName
IF ( $GUID ) {
$GUID | ForEach-Object {
Write-Output "Uninstalling: $(( Get-ItemProperty "$UninstallKeys\$_" ).DisplayName) "
Start-Process -Wait -FilePath "MsiExec.exe" -ArgumentList "/X$_ /qn /norestart"
}
}
ELSE {
Write-Output "$AppName installation not found in $UninstallKeys"
}
}
}
}
# Stop PuTTY process if running
Stop-PuTTYProcess
# Check and delete PuTTY installations
Write-Output "Checking for PuTTY EXE Installations..."
Remove-PuTTY
Write-Output "Checking for PuTTY MSI Installations..."
Remove-PuTTYMSI
PowerShell power user?
Check out The PowerShell Podcast: a weekly exploration of tips and tricks to help you step up your PowerShell game.
How to uninstall PuTTY with PDQ Deploy & Inventory
Prefer a more automated approach that requires very little work? Same. That’s why we built a package for PDQ Deploy & Inventory to silently uninstall PuTTY.
You can uninstall PuTTY with PDQ Deploy & Inventory in just a few steps. Let’s start with PDQ Inventory to get a quick glance of the machines in our environment with PuTTY installed. Then, we can move on to PDQ Deploy to download and deploy the package to uninstall those PuTTY instances.
PDQ Inventory
PDQ Inventory gives us a bird’s-eye view of which machines in our environment have a PuTTY instance installed via the Collection Library.
Here’s how to get where we need to go.
1. Open up PDQ Inventory.
2. In the left-hand panel, tick the arrow next to Collection Library.
3. Click the arrow next to Applications to expand that section.
4. Click the arrow next to Utilities.
5. Click the arrow next to SSH Utilities.
6. Click the arrow next to PuTTY. From here, we can see which of our devices run which version of PuTTY: the 32-bit or 64-bit version.
7. Now, click PuTTY instead of the arrow next to it. To the right, we can see which devices have PuTTY installed.
This process really beats running a search on every computer in your environment to see where PuTTY is installed, am I right? 😅
PDQ Deploy
Now, let’s turn to our old pal PDQ Deploy to download and deploy the package that will rid us of PuTTY.
1. Open up PDQ Deploy.
2. Click Package Library at the top of the pane.
3. In the Filter field, type in putty.
4. Click on the Uninstall PuTTY result. Then, click the Download Selected button.
Now, you have a fancy package to (silently!) deploy to the devices we just looked at in PDQ Inventory.
Let’s deploy that package.
1. In the left-hand panel, under Packages, right-click the package we just downloaded: Uninstall PuTTY.
2. Select Deploy Once.
3. In the new pane, click Choose Targets. Hover over PDQ Inventory, and then click Collection.
4. Now, follow the same navigation path we used in PDQ Inventory: Collection Library > Applications > Utilities > SSH Utilities > PuTTY.
5. Click PuTTY, and then click OK.
6. You should now see all the target devices we discovered with PDQ Inventory. If all looks correct, hit Deploy Now.
And that’s it! PuTTY has disappeared from your target devices into the vast abyss of uninstalled programs.
Let’s face it: PuTTY is putty in PDQ Deploy & Inventory’s capable hands. (Surely you saw that pun coming.)
How to uninstall PuTTY with PDQ Connect
The steps to uninstall PuTTY with PDQ Connect are slightly different from those for PDQ Deploy & Inventory because of how groups work in Connect. But never fear: This process is still very simple. 😊
Let’s do it!
Creating a dynamic group in PDQ Connect
First, we need to create a dynamic group in Connect. Here’s how we do that.
1. Open up PDQ Connect.
2. Near the bottom left of the pane, click Create group.
3. In the Create group dialog box, enter a name for your group. Then, select Dynamic as the group type.
4. Next, we need to set up our logic so Connect knows which devices to pull into our group. In this case, we can use the logic where software name contains putty.
5. Click Create. In a few moments, you should have a new group that displays all the devices in your environment with a PuTTY instance installed.
Now, we can grab our package from the Package Library and deploy it to all machines in our group.
Deploying a package to a dynamic group in PDQ Connect
First, let’s find our package in the Package Library.
1. On the left-hand side of the screen in Connect, click Packages.
2. In the Search packages field, type in putty.
3. Tick the box next to Uninstall PuTTY, and then click Deploy.
4. In the Create deployment dialog box, you should see the Uninstall PuTTY package already selected. In the Search devices and groups field, type in the name of the dynamic group you just created and then click on it.
5. Click Deploy.
Once the package has been deployed, PuTTY disappears into the void, and our dynamic group becomes a lonely, deviceless group.
And there you have it: three simple ways to silently uninstall PuTTY. If simple is your favorite word in the workplace, check out PDQ’s product suite, which was built for sysadmins, by sysadmins. See how simple, secure, and pretty damn quick device management can be with a free 14-day trial.