{"id":3161,"date":"2026-05-12T10:52:42","date_gmt":"2026-05-12T08:52:42","guid":{"rendered":"https:\/\/itsimple.info\/?p=3161"},"modified":"2026-05-12T10:52:43","modified_gmt":"2026-05-12T08:52:43","slug":"how-to-force-remove-uninstall-vmware-tools-using-powershell","status":"publish","type":"post","link":"https:\/\/itsimple.info\/?p=3161","title":{"rendered":"How to Force-Remove \/ uninstall VMware Tools Using PowerShell"},"content":{"rendered":"\n<p><br>When the standard VMware Tools uninstaller fails, breaks mid-way, or leaves orphaned registry keys, this PowerShell script surgically removes every trace: registry entries, services, and filesystem directories. A reboot finishes the job.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why the standard uninstaller sometimes fails<\/h2>\n\n\n\n<p>VMware Tools is generally well-behaved \u2014 but there are scenarios where the built-in Windows installer (MSI) gets stuck or leaves residual artifacts that block a clean reinstallation:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A failed or interrupted upgrade leaves the MSI in a broken state<\/li>\n\n\n\n<li>The VM was cloned or snapshotted mid-installation<\/li>\n\n\n\n<li>You\u2019re migrating the guest OS from one hypervisor to another<\/li>\n\n\n\n<li>The Add\/Remove Programs entry is missing but services and files remain<\/li>\n\n\n\n<li>You need to do a clean reinstall of a specific Tools version<\/li>\n<\/ul>\n\n\n\n<p>In these cases, the automated script below is far more reliable than hunting through the registry manually.<\/p>\n\n\n\n<p><strong>Before you begin:<\/strong>\u00a0Run this script only on a VM that is being migrated away from VMware, decommissioned, or undergoing a clean reinstall. Removing VMware Tools from a running VMware-hosted VM without reinstalling will disable mouse integration, shared clipboard, time synchronization, and balloon memory management.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PowerShell 5.0 or higher (built into Windows Server 2016+; use Windows Management Framework for older OSes)<\/li>\n\n\n\n<li>An elevated (Run as Administrator) PowerShell session \u2014 the script touches HKLM and HKCR registry hives<\/li>\n\n\n\n<li>A snapshot or backup taken\u00a0<em>before<\/em>\u00a0running, in case a rollback is needed<\/li>\n\n\n\n<li>The\u00a0<code>Remove_VMwareTools.ps1<\/code>\u00a0script saved locally on the guest VM<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">The script<\/h2>\n\n\n\n<p class=\"has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-f42c39c109660ce69f237719d084a0dc\">Download and save the file as\u00a0<code><a href=\"https:\/\/itsimple.info\/wp-content\/uploads\/2026\/05\/Remove_VMwareTools.ps1_.txt\">Remove_VMwareTools.ps1<\/a><\/code>, (delete the TXT in the end of the file name) then review it before executing:<\/p>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-d89eae62-c47a-4a89-82c3-321ac4550b3f\" href=\"https:\/\/itsimple.info\/wp-content\/uploads\/2026\/05\/Remove_VMwareTools.ps1_.txt\">Remove_VMwareTools.ps1<\/a><a href=\"https:\/\/itsimple.info\/wp-content\/uploads\/2026\/05\/Remove_VMwareTools.ps1_.txt\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-d89eae62-c47a-4a89-82c3-321ac4550b3f\">Download<\/a><\/div>\n\n\n\n<p>PowerShell \u2014 Remove_VMwareTools.ps1<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><!-- wp:preformatted --><br><pre class=\"wp-block-preformatted\"># This script will manually rip out all VMware Tools registry entries and files<br># Tested for Windows Server 2019, 2016, and 2012 R2+<br><br># \u2500\u2500 Step 1: Discover the VMware Tools installer IDs \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500<br>function Get-VMwareToolsInstallerID {<br>    foreach ($item in $(Get-ChildItem Registry::HKEY_CLASSES_ROOT\\Installer\\Products)) {<br>        If ($item.GetValue('ProductName') -eq 'VMware Tools') {<br>            return @{<br>                reg_id = $item.PSChildName<br>                msi_id = [Regex]::Match($item.GetValue('ProductIcon'), '(?&lt;={)(.*?)(?=})') |<br>                         Select-Object -ExpandProperty Value<br>            }<br>        }<br>    }<br>}<br><br>$vmware_tools_ids = Get-VMwareToolsInstallerID<br><br># \u2500\u2500 Step 2: Build the list of registry targets \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500<br>$reg_targets = @(<br>    \"Registry::HKEY_CLASSES_ROOT\\Installer\\Features\\\",<br>    \"Registry::HKEY_CLASSES_ROOT\\Installer\\Products\\\",<br>    \"HKLM:\\SOFTWARE\\Classes\\Installer\\Features\\\",<br>    \"HKLM:\\SOFTWARE\\Classes\\Installer\\Products\\\",<br>    \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\S-1-5-18\\Products\\\"<br>)<br><br>$VMware_Tools_Directory  = \"C:\\Program Files\\VMware\"<br>$VMware_Common_Directory = \"C:\\Program Files\\Common Files\\VMware\"<br><br>$targets = @()<br>If ($vmware_tools_ids) {<br>    foreach ($item in $reg_targets) {<br>        $targets += $item + $vmware_tools_ids.reg_id<br>    }<br>    $targets += \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{$($vmware_tools_ids.msi_id)}\"<br>}<br><br># Legacy entries for Windows Server 2008 \/ 2012 (pre-10.0 kernel)<br>If ([Environment]::OSVersion.Version.Major -lt 10) {<br>    $targets += \"HKCR:\\CLSID\\{D86ADE52-C4D9-4B98-AA0D-9B0C7F1EBBC8}\"<br>    $targets += \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{9709436B-5A41-4946-8BE7-2AA433CAF108}\"<br>    $targets += \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{FE2F6A2C-196E-4210-9C04-2B1BC21F07EF}\"<br>}<br><br>If (Test-Path \"HKLM:\\SOFTWARE\\VMware, Inc.\")   { $targets += \"HKLM:\\SOFTWARE\\VMware, Inc.\" }<br>If (Test-Path $VMware_Tools_Directory)          { $targets += $VMware_Tools_Directory }<br>If (Test-Path $VMware_Common_Directory)         { $targets += $VMware_Common_Directory }<br><br># \u2500\u2500 Step 3: Collect VMware services \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500<br>$services  = Get-Service -DisplayName \"VMware*\"<br>$services += Get-Service -DisplayName \"GISvc\"<br><br># \u2500\u2500 Step 4: Confirm and execute \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500<br>Write-Host \"The following registry keys, filesystem folders, and services will be deleted:\"<br>If (!$targets -and !$services) { Write-Host \"Nothing to do!\" }<br>Else {<br>    $targets; $services<br>    $user_confirmed = Read-Host \"Continue (y\/n)\"<br>    If ($user_confirmed -eq \"y\") {<br>        $services | Stop-Service -Confirm:$false<br>        If (Get-Command Remove-Service -errorAction SilentlyContinue) {<br>            $services | Remove-Service -Confirm:$false<br>        } Else {<br>            foreach ($s in $services) { sc.exe DELETE $($s.Name) }<br>        }<br>        foreach ($item in $targets) {<br>            If(Test-Path $item) { Remove-Item -Path $item -Recurse }<br>        }<br>        Write-Host \"Done. Reboot to complete removal.\"<br>    } Else { Write-Host \"Failed to get user confirmation\" }<br>}<\/pre><br><!-- \/wp:preformatted --><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">What the script does \u2014 step by step<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Phase 1 \u2014 Discover installer IDs<\/h3>\n\n\n\n<p>The function\u00a0<code>Get-VMwareToolsInstallerID<\/code>\u00a0walks\u00a0<code>HKCR\\Installer\\Products<\/code>\u00a0and finds the entry whose\u00a0<code>ProductName<\/code>\u00a0equals \u201cVMware Tools\u201d. It returns two values:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>reg_id<\/code>\u00a0\u2014 the scrambled GUID used as the folder key across multiple registry hives<\/li>\n\n\n\n<li><code>msi_id<\/code>\u00a0\u2014 the standard GUID extracted from the\u00a0<code>ProductIcon<\/code>\u00a0value, used in the\u00a0<code>Uninstall<\/code>\u00a0key<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Phase 2 \u2014 Build the target list<\/h3>\n\n\n\n<p>Using the discovered IDs, the script compiles a list of every registry path that holds VMware installer metadata:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-left\" data-align=\"left\">Registry hive<\/th><th class=\"has-text-align-left\" data-align=\"left\">Purpose<\/th><\/tr><\/thead><tbody><tr><td>HKCR\\Installer\\Features\\{id}<\/td><td>Feature advertisement records<\/td><\/tr><tr><td>HKCR\\Installer\\Products\\{id}<\/td><td>Core product registration<\/td><\/tr><tr><td>HKLM\\SOFTWARE\\Classes\\Installer\\Features\\{id}<\/td><td>WOW64 mirror of Features<\/td><\/tr><tr><td>HKLM\\SOFTWARE\\Classes\\Installer\\Products\\{id}<\/td><td>WOW64 mirror of Products<\/td><\/tr><tr><td>HKLM\\\u2026\\UserData\\S-1-5-18\\Products\\{id}<\/td><td>Per-machine install data (SYSTEM account)<\/td><\/tr><tr><td>HKLM\\\u2026\\Uninstall\\{msi_id}<\/td><td>Add\/Remove Programs entry<\/td><\/tr><tr><td>HKLM\\SOFTWARE\\VMware, Inc.<\/td><td>VMware application settings<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>It also adds two filesystem directories to the list:\u00a0<code>C:\\Program Files\\VMware<\/code>\u00a0and\u00a0<code>C:\\Program Files\\Common Files\\VMware<\/code>\u00a0(the latter can hold up to ~500 MB of shared libraries).<\/p>\n\n\n\n<p>For guests running Windows Server 2008 or 2012 (kernel version < 10), three additional hard-coded legacy GUIDs are appended to cover CLSIDs that don\u2019t exist on newer OSes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Phase 3 \u2014 Enumerate VMware services<\/h3>\n\n\n\n<p>The script queries the Service Control Manager for all services whose display name starts with \u201cVMware\u201d, plus\u00a0<code>GISvc<\/code>\u00a0(the VMware Guest Introspection service), which uses a different naming convention.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Phase 4 \u2014 Confirm and execute<\/h3>\n\n\n\n<p>Before touching anything, the script prints the full target list and asks for explicit confirmation (<code>y<\/code>). On approval it:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Stops all VMware services via\u00a0<code>Stop-Service<\/code><\/li>\n\n\n\n<li>Removes services \u2014 using\u00a0<code>Remove-Service<\/code>\u00a0on PowerShell 6+, or falling back to\u00a0<code>sc.exe DELETE<\/code>\u00a0on older versions<\/li>\n\n\n\n<li>Iterates every target and calls\u00a0<code>Remove-Item -Recurse<\/code>\u00a0if the path exists<\/li>\n\n\n\n<li>Prompts the operator to reboot to flush any in-memory driver handles<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">How to run it<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Copy\u00a0<code>Remove_VMwareTools.ps1<\/code>\u00a0to the guest VM (e.g.\u00a0<code>C:\\Temp\\<\/code>)<\/li>\n\n\n\n<li>Open PowerShell as Administrator<\/li>\n\n\n\n<li>If execution policy blocks scripts, temporarily unblock:\u00a0<code>Set-ExecutionPolicy Bypass -Scope Process<\/code><\/li>\n\n\n\n<li>Run:\u00a0<code>.\\Remove_VMwareTools.ps1<\/code><\/li>\n\n\n\n<li>Review the list of targets printed on screen, type\u00a0<code>y<\/code>\u00a0and press Enter to confirm<\/li>\n\n\n\n<li>Reboot the VM when prompted<\/li>\n<\/ul>\n\n\n\n<p><strong>After reboot:<\/strong>\u00a0Confirm removal by checking\u00a0<code>Services.msc<\/code>\u00a0(no VMware entries) and\u00a0<code>C:\\Program Files\\VMware<\/code>\u00a0(directory should be gone). You can now perform a clean installation of VMware Tools or migrate the VM to a different hypervisor without conflicts.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently asked questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">What if the script reports \u201cNothing to do\u201d?<\/h3>\n\n\n\n<p>VMware Tools is either not installed, or was already cleanly removed. No action is needed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Will this work if VMware Tools is actively running?<\/h3>\n\n\n\n<p>Yes \u2014 the script stops services before deletion. You do not need to stop them manually first.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Is this safe to run remotely via PSRemoting or RDP?<\/h3>\n\n\n\n<p>Yes. The only dependency is an elevated PowerShell session. Run it via\u00a0<code>Invoke-Command<\/code>\u00a0or a remote desktop session \u2014 both work fine.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What about Windows 10 \/ Windows 11 desktop guests?<\/h3>\n\n\n\n<p>The script targets Windows Server 2008\u20132019 and was not tested on desktop editions. The registry paths are the same, but desktop VMs are out of scope for this guide.<\/p>\n\n\n\n<figure class=\"wp-block-pullquote has-vivid-green-cyan-color has-text-color has-link-color has-x-large-font-size wp-elements-582aabdefc765d0ac722b7b2f4dfdd5a\"><blockquote><p><strong>Good Luck<\/strong><\/p><\/blockquote><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>When the standard VMware Tools uninstaller fails, breaks mid-way, or leaves orphaned registry keys, this PowerShell script surgically removes every trace: registry entries, services, and filesystem directories. A reboot finishes the job. Why the standard uninstaller sometimes fails VMware Tools is generally well-behaved \u2014 but there are scenarios where the built-in Windows installer (MSI) gets [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,12,18,19,14,15],"tags":[],"class_list":["post-3161","post","type-post","status-publish","format-standard","hentry","category-hyper-v","category-tutorials","category-virtualization","category-vmware","category-windows","category-windows-server"],"_links":{"self":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts\/3161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3161"}],"version-history":[{"count":4,"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts\/3161\/revisions"}],"predecessor-version":[{"id":3166,"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts\/3161\/revisions\/3166"}],"wp:attachment":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}