{"id":819,"date":"2025-07-09T16:31:21","date_gmt":"2025-07-09T16:31:21","guid":{"rendered":"https:\/\/jackharvest.com\/?p=819"},"modified":"2026-09-13T23:04:05","modified_gmt":"2026-09-13T23:04:05","slug":"patchcleanerps-clean-windows-installer-folder","status":"publish","type":"post","link":"https:\/\/jackharvest.com\/index.php\/2025\/07\/09\/patchcleanerps-clean-windows-installer-folder\/","title":{"rendered":"PatchCleanerPS \u2013 Safely Clean Up C:\\Windows\\Installer with PowerShell"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1136\" height=\"202\" src=\"https:\/\/jackharvest.com\/wp-content\/uploads\/2026\/09\/patchcleanerps-banner.jpg\" alt=\"PatchCleanerPS banner\" class=\"wp-image-749\" srcset=\"https:\/\/jackharvest.com\/wp-content\/uploads\/2026\/09\/patchcleanerps-banner.jpg 1136w, https:\/\/jackharvest.com\/wp-content\/uploads\/2026\/09\/patchcleanerps-banner-300x53.jpg 300w, https:\/\/jackharvest.com\/wp-content\/uploads\/2026\/09\/patchcleanerps-banner-1024x182.jpg 1024w, https:\/\/jackharvest.com\/wp-content\/uploads\/2026\/09\/patchcleanerps-banner-768x137.jpg 768w\" sizes=\"auto, (max-width: 1136px) 100vw, 1136px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Go look at <code>C:\\Windows\\Installer<\/code> on a machine that\u2019s been around a while. It\u2019s a hidden folder full of <code>.msi<\/code> and <code>.msp<\/code> files, and a lot of them belong to software and patches that aren\u2019t installed anymore \u2014 orphans, taking up gigabytes, that nothing will ever clean up for you.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For years the answer was John Crawford\u2019s PatchCleaner from homedev.com.au. It\u2019s retired now, so I rewrote the idea from scratch, entirely in PowerShell. <strong>PatchCleanerPS<\/strong> cross-references every installer file against what\u2019s actually installed and flags the ones nothing points at.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/github.com\/jackharvest\/PatchCleanerPS\/releases\/latest\">Download PatchCleanerPS<\/a><\/div>\n\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/github.com\/jackharvest\/PatchCleanerPS\">View on GitHub<\/a><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Features<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignright size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"418\" height=\"384\" src=\"https:\/\/jackharvest.com\/wp-content\/uploads\/2026\/09\/patchcleanerps-icon.png\" alt=\"PatchCleanerPS icon: a yellow recycling bin with a blue lid\" class=\"wp-image-752\" style=\"width:160px\" srcset=\"https:\/\/jackharvest.com\/wp-content\/uploads\/2026\/09\/patchcleanerps-icon.png 418w, https:\/\/jackharvest.com\/wp-content\/uploads\/2026\/09\/patchcleanerps-icon-300x276.png 300w\" sizes=\"auto, (max-width: 418px) 100vw, 418px\" \/><\/figure>\n<\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Identifies <strong>orphaned <code>.msi<\/code> and <code>.msp<\/code> files<\/strong><\/li>\n\n<li><strong>Interactive<\/strong> and <strong>automatic<\/strong> modes<\/li>\n\n<li>A <strong>dry-run<\/strong> mode to preview exactly what would be affected<\/li>\n\n<li>A <strong>move mode<\/strong> that quarantines files instead of deleting them<\/li>\n\n<li><strong>Vendor exclusions<\/strong> (e.g. leave everything from Microsoft and Adobe alone)<\/li>\n\n<li>Cleans up <strong>empty folders<\/strong> in <code>C:\\Windows\\Installer<\/code> afterwards<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Running it<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1103\" height=\"417\" src=\"https:\/\/jackharvest.com\/wp-content\/uploads\/2026\/09\/patchcleanerps-console.png\" alt=\"PatchCleanerPS running in a PowerShell console, showing run modes\" class=\"wp-image-750\" srcset=\"https:\/\/jackharvest.com\/wp-content\/uploads\/2026\/09\/patchcleanerps-console.png 1103w, https:\/\/jackharvest.com\/wp-content\/uploads\/2026\/09\/patchcleanerps-console-300x113.png 300w, https:\/\/jackharvest.com\/wp-content\/uploads\/2026\/09\/patchcleanerps-console-1024x387.png 1024w, https:\/\/jackharvest.com\/wp-content\/uploads\/2026\/09\/patchcleanerps-console-768x290.png 768w\" sizes=\"auto, (max-width: 1103px) 100vw, 1103px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Run it as Administrator on Windows 10 or later, with PowerShell 5.1 or PowerShell Core. Either the script or the compiled <code>.exe<\/code> from Releases works the same way:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\\PatchCleanerPS.ps1            # interactive\n.\\PatchCleanerPS.ps1 -Auto      # prompts for each orphan\n\n# Preview, no prompts, leaving Microsoft and Adobe installers alone\n.\\PatchCleanerPS.ps1 -AutoDryAll -ExcludeVendors 'Microsoft','Adobe'<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Parameter<\/th><th>What it does<\/th><\/tr><\/thead><tbody><tr><td><code>-Auto<\/code><\/td><td>Delete orphaned files, prompting for each one<\/td><\/tr><tr><td><code>-AutoAll<\/code><\/td><td>Delete <strong>all<\/strong> orphaned files without prompting<\/td><\/tr><tr><td><code>-AutoDry<\/code><\/td><td>Dry run, with confirmation prompts<\/td><\/tr><tr><td><code>-AutoDryAll<\/code><\/td><td>Dry run, no prompts<\/td><\/tr><tr><td><code>-ExcludeVendors<\/code><\/td><td>Skip files from the vendors you list<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Safety first<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Deleting system installers is serious business, so: every file is cross-referenced against installed applications and patches in the registry, the dry run shows you everything before anything changes, move mode lets you quarantine rather than delete, and vendor exclusions keep the big names untouched.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Built for deployment<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The compiled <code>.exe<\/code> mirrors the script and supports silent parameters, which makes it easy to push through <strong>SCCM, Intune, PDQ Deploy<\/strong> or any RMM. The README includes a ready-made script for SCCM\u2019s <em>Scripts<\/em> feature that pulls the latest release from GitHub, runs a <code>-AutoDryAll<\/code> headlessly, and returns the report \u2014 so you can see how much space is recoverable across a fleet before you touch a single machine.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">MIT licensed. Inspired by the retired PatchCleaner by John Crawford; rewritten from scratch in PowerShell. Pull requests, bug reports and enterprise deployment tips are all welcome.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Free and open source, and it\u2019s staying that way. If it saved you some time, you can <a href=\"https:\/\/www.buymeacoffee.com\/jackharvest\">buy me a coffee<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C:\\Windows\\Installer quietly fills up with orphaned .msi and .msp files. PatchCleanerPS is a PowerShell successor to the retired PatchCleaner: it finds the orphans, lets you dry-run, move or delete them, and deploys cleanly through SCCM, Intune or PDQ.<\/p>\n","protected":false},"author":1,"featured_media":844,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_seopress_titles_title":"PatchCleanerPS \u2013 Clean Orphaned MSI\/MSP from Windows Installer","_seopress_titles_desc":"Reclaim disk space from C:\\Windows\\Installer. PatchCleanerPS finds orphaned .msi and .msp files with dry-run, move and vendor exclusions. SCCM and Intune ready.","_seopress_robots_index":"","_seopress_robots_follow":"","_seopress_robots_imageindex":"","_seopress_robots_snippet":"","_seopress_robots_primary_cat":"","_seopress_robots_breadcrumbs":"","_seopress_robots_freeze_modified_date":"","_seopress_robots_custom_modified_date":"","_seopress_robots_canonical":"","_seopress_social_fb_title":"","_seopress_social_fb_desc":"","_seopress_social_fb_img":"","_seopress_social_fb_img_attachment_id":0,"_seopress_social_fb_img_width":0,"_seopress_social_fb_img_height":0,"_seopress_social_twitter_title":"","_seopress_social_twitter_desc":"","_seopress_social_twitter_img":"","_seopress_social_twitter_img_attachment_id":0,"_seopress_social_twitter_img_width":0,"_seopress_social_twitter_img_height":0,"_seopress_redirections_value":"","_seopress_redirections_enabled":"","_seopress_redirections_enabled_regex":"","_seopress_redirections_logged_status":"","_seopress_redirections_param":"","_seopress_redirections_type":0,"_seopress_analysis_target_kw":"clean windows installer folder,c:\\windows\\installer cleanup,patchcleaner alternative,orphaned msp files,delete msi files safely,patchcleaner powershell","neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[77,163],"tags":[175,177,173,174,178,171,176,179,10,172],"class_list":["post-819","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-projects","category-windows","tag-disk-cleanup","tag-intune","tag-msi","tag-msp","tag-pdq-deploy","tag-powershell","tag-sccm","tag-sysadmin","tag-windows","tag-windows-installer"],"_links":{"self":[{"href":"https:\/\/jackharvest.com\/index.php\/wp-json\/wp\/v2\/posts\/819","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jackharvest.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jackharvest.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jackharvest.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jackharvest.com\/index.php\/wp-json\/wp\/v2\/comments?post=819"}],"version-history":[{"count":1,"href":"https:\/\/jackharvest.com\/index.php\/wp-json\/wp\/v2\/posts\/819\/revisions"}],"predecessor-version":[{"id":820,"href":"https:\/\/jackharvest.com\/index.php\/wp-json\/wp\/v2\/posts\/819\/revisions\/820"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jackharvest.com\/index.php\/wp-json\/wp\/v2\/media\/844"}],"wp:attachment":[{"href":"https:\/\/jackharvest.com\/index.php\/wp-json\/wp\/v2\/media?parent=819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jackharvest.com\/index.php\/wp-json\/wp\/v2\/categories?post=819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jackharvest.com\/index.php\/wp-json\/wp\/v2\/tags?post=819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}