Skip to content

Instantly share code, notes, and snippets.

@tyhallcsu
Created August 18, 2025 17:51
Show Gist options
  • Select an option

  • Save tyhallcsu/2fad00af39b5b439e40d10ca29dff06b to your computer and use it in GitHub Desktop.

Select an option

Save tyhallcsu/2fad00af39b5b439e40d10ca29dff06b to your computer and use it in GitHub Desktop.
This PowerShell script removes leftover StartAllBack registry keys.

🧹 StartAllBack Registry Cleanup Script

This PowerShell script removes leftover StartAllBack registry keys under HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID.

It checks for empty subkeys and deletes them safely to clean up clutter left behind by StartAllBack.

⚠️ Disclaimer

  • Use this script at your own risk.
  • I am not responsible for any damage or issues caused by running it.

Features

  • Prompts for user confirmation before execution
  • Enumerates CLSID registry keys and detects orphaned ones
  • Cleans up only keys without subkeys (avoids breaking dependencies)
  • Restarts Windows Explorer automatically after cleanup
  • Ends with a graceful exit
Write-Output ''
Write-Output 'StartAllBack Cleanup by sharmanhall'
Write-Output 'This script will clean up the registry keys'
Write-Output ''
Write-Output 'CAUTION!! Use this script at your own risk.'
Write-Output 'I am not responsible for any damage that may occur as a result of running this script.'
Write-Output ''
Write-Output 'Do you want to begin?'
$x = Read-Host '[Y/N]'
if (-Not($x -eq "Y" -or $x -eq "y")) {
Write-Output 'Cancelled by user!'
exit
}
Write-Output ''
$keys = Get-Item -Path Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID\* | Select-Object -ExpandProperty Name
$keys = $keys | Where-Object { $_ -cmatch '\{[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{8}.*$' }
foreach ($key in $keys) {
# Look for subkeys
$subkeys = Get-Item -Path ('Registry::' + $key + "\*") | Select-Object -ExpandProperty Name
$subkeys_count = $subkeys | Measure-Object | Select-Object -ExpandProperty Count
if (-Not ($subkeys_count -eq 0)) {
continue
}
Write-Output ''
Write-Output 'Cleaning...'
Write-Output ''
Remove-Item -Path ('Registry::' + $key)
}
Write-Output 'Cleaned Successfully!'
Write-Output ''
Write-Output 'Restarting explorer...'
Stop-Process -Name explorer -Force
Write-Output ''
Write-Output 'All DONE'
Write-Output ''
Write-Host "Press any key to Exit..."
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')
Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.SendKeys]::SendWait('%{F4}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment