Skip to content

Instantly share code, notes, and snippets.

@TheFallender
Created October 13, 2022 12:35
Show Gist options
  • Save TheFallender/f388713fc39670774fa7e94833670f65 to your computer and use it in GitHub Desktop.
Save TheFallender/f388713fc39670774fa7e94833670f65 to your computer and use it in GitHub Desktop.
Script to debloat the LossLessCut installation from https://community.chocolatey.org/packages/lossless-cut
# To the one that made the original bloatware script, you will be glad to hear that I will give you my most sincere and lovely fuck you.
# Like, who the adds +1500 entries to the registry and doesn't delete them when uninstalling.
# Still, thank you for making the package and mantaining it.
# So, while I have tested this script, I recommend checking it just in case I screwed up in something.
# Remove the media association with LosslessCut
if ((Test-Path -LiteralPath "HKLM:\SOFTWARE\Clients\Media\LosslessCut") -eq $true) {
Remove-Item "HKLM:\SOFTWARE\Clients\Media\LosslessCut" -Recurse -Force -Confirm:$false;
};
# Remove LosslessCut from Applications
if ((Test-Path -LiteralPath "HKLM:\SOFTWARE\Classes\Applications\LosslessCut.exe") -eq $true) {
Remove-Item "HKLM:\SOFTWARE\Classes\Applications\LosslessCut.exe" -Recurse -Force -Confirm:$false;
};
# Remove LosslessCut's property from RegisteredApplications
if (((Get-Item "HKLM:\SOFTWARE\RegisteredApplications").Property -contains "LosslessCut") -eq $true) {
Remove-ItemProperty -Path "HKLM:\SOFTWARE\RegisteredApplications" -Name "LosslessCut";
};
# The extensions to de-bloat. 83 to be precise.
$extensions = @(
"3g2","3gp","8svx","aa","aac","aax","act","aiff","alac","amr","amv",
"ape","asf","au","avi","awb","cda","dct","drc","dss","dvf","f4a",
"f4b","f4p","f4v","flac","flv","gif","gifv","gsm","iklax","ivs",
"m2ts","m2v","m4a","m4b","m4p","m4v","mkv","mmf","mng","mogg","mov",
"mp2","mp3","mp4","mpc","mpe","mpeg","mpg","mpv","msv","mts","mxf",
"nmf","nsf","nsv","oga","ogg","ogv","opus","qt","ra","rf64","rm",
"rmvb","roq","sln","svi","ts","tta","vob","voc","vox","wav","webm",
"wma","wmv","wv","yuv","tsv","3gpp","webm"
);
foreach ($extension in $extensions) {
# Remove the OpenWithList key
if ((Test-Path -LiteralPath "HKLM:\SOFTWARE\Classes\.$extension\OpenWithList\LosslessCut.exe") -eq $true) {
Remove-Item "HKLM:\SOFTWARE\Classes\.$extension\OpenWithList\LosslessCut.exe" -Recurse -Force -Confirm:$false;
};
# Remove the OpenWithProgids property
if (((Get-Item "HKLM:\SOFTWARE\Classes\.$extension\OpenWithProgids\").Property -contains ("LosslessCut." + "$extension".ToUpper())) -eq $true) {
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Classes\.$extension\OpenWithProgids\" -Name ("LosslessCut." + "$extension".ToUpper());
};
# Remove the LosslessCut.extension key
if ((Test-Path -LiteralPath ("HKLM:\SOFTWARE\Classes\LossLessCut." + "$extension".ToUpper())) -eq $true) {
Remove-Item ("HKLM:\SOFTWARE\Classes\LossLessCut." + "$extension".ToUpper()) -Recurse -Force -Confirm:$false;
};
# Remove the FileAssociations key
if ((Test-Path -LiteralPath "HKLM:\SOFTWARE\Classes\SystemFileAssociations\.$extension\Shell\losslesscut") -eq $true) {
Remove-Item "HKLM:\SOFTWARE\Classes\SystemFileAssociations\.$extension\Shell\losslesscut" -Recurse -Force -Confirm:$false;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment