{"id":7219,"date":"2023-08-15T06:18:21","date_gmt":"2023-08-15T06:18:21","guid":{"rendered":"https:\/\/pariswells.com\/blog\/?p=7219"},"modified":"2023-08-15T06:18:22","modified_gmt":"2023-08-15T06:18:22","slug":"windows-unquoted-service-path-remediation","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/research\/windows-unquoted-service-path-remediation","title":{"rendered":"Windows Unquoted Service Path Remediation"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Detection<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">$i = 0\r\n\r\n$BaseKeys = \"HKLM:\\System\\CurrentControlSet\\Services\",                                  #Services\r\n\r\n            \"HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\",                #32bit Uninstalls\r\n\r\n            \"HKLM:\\Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\"     #64bit Uninstalls\r\n\r\n#Blacklist for keys to ignore\r\n\r\n$BlackList = $Null\r\n\r\n#Create an ArrayList to store results in\r\n\r\n$Values = New-Object System.Collections.ArrayList\r\n\r\n#Discovers all registry keys under the base keys\r\n\r\n$DiscKeys = Get-ChildItem -Recurse -Directory $BaseKeys -Exclude $BlackList -ErrorAction SilentlyContinue |\r\n\r\n            Select-Object -ExpandProperty Name | %{($_.ToString().Split('\\') | Select-Object -Skip 1) -join '\\'}\r\n\r\n#Open the local registry\r\n\r\n$Registry = [Microsoft.Win32.RegistryKey]::OpenBaseKey('LocalMachine', 'Default')\r\n\r\nForEach ($RegKey in $DiscKeys)\r\n\r\n{\r\n\r\n    #Open each key with write permissions\r\n\r\n    Try { $ParentKey = $Registry.OpenSubKey($RegKey, $True) }\r\n\r\n    Catch { Write-Debug \"Unable to open $RegKey\" }\r\n\r\n    #Test if registry key has values\r\n\r\n    If ($ParentKey.ValueCount -gt 0)\r\n\r\n    {\r\n\r\n        $MatchedValues = $ParentKey.GetValueNames() | ?{ $_ -eq \"ImagePath\" -or $_ -eq \"UninstallString\" }\r\n\r\n        ForEach ($Match in $MatchedValues)\r\n\r\n        {\r\n\r\n            #RegEx that matches values containing .exe with a space in the exe path and no double quote encapsulation\r\n\r\n            $ValueRegEx = '(^(?!\\u0022).*\\s.*\\.[Ee][Xx][Ee](?&lt;!\\u0022))(.*$)'\r\n\r\n            $Value = $ParentKey.GetValue($Match)\r\n\r\n            #Test if value matches RegEx\r\n\r\n            If ($Value -match $ValueRegEx)\r\n\r\n            {\r\n\r\n                $RegType = $ParentKey.GetValueKind($Match)\r\n\r\n                #Uses the matches from the RegEx to build a new entry encapsulating the exe path with double quotes\r\n\r\n                $Correction = \"$([char]34)$($Matches[1])$([char]34)$($Matches[2])\"\r\n\r\n\r\n\r\n                #Attempt to correct the entry\r\n\r\n                $i++\r\n\r\n            }\r\n\r\n        }\r\n\r\n    }\r\n\r\n    $ParentKey.Close()\r\n\r\n}\r\n\r\n$Registry.Close()\r\n\r\n\r\n\r\nIF($i -eq 0){ Exit 0 }else{ Exit 1 }\r\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Remediation<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">$BaseKeys = \"HKLM:\\System\\CurrentControlSet\\Services\",                                  #Services\r\n\r\n            \"HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\",                #32bit Uninstalls\r\n\r\n            \"HKLM:\\Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\"     #64bit Uninstalls\r\n\r\n#Blacklist for keys to ignore\r\n\r\n$BlackList = $Null\r\n\r\n#Create an ArrayList to store results in\r\n\r\n$Values = New-Object System.Collections.ArrayList\r\n\r\n#Discovers all registry keys under the base keys\r\n\r\n$DiscKeys = Get-ChildItem -Recurse -Directory $BaseKeys -Exclude $BlackList -ErrorAction SilentlyContinue |\r\n\r\n            Select-Object -ExpandProperty Name | %{($_.ToString().Split('\\') | Select-Object -Skip 1) -join '\\'}\r\n\r\n#Open the local registry\r\n\r\n$Registry = [Microsoft.Win32.RegistryKey]::OpenBaseKey('LocalMachine', 'Default')\r\n\r\nForEach ($RegKey in $DiscKeys)\r\n\r\n{\r\n\r\n    #Open each key with write permissions\r\n\r\n    Try { $ParentKey = $Registry.OpenSubKey($RegKey, $True) }\r\n\r\n    Catch { Write-Debug \"Unable to open $RegKey\" }\r\n\r\n    #Test if registry key has values\r\n\r\n    If ($ParentKey.ValueCount -gt 0)\r\n\r\n    {\r\n\r\n        $MatchedValues = $ParentKey.GetValueNames() | ?{ $_ -eq \"ImagePath\" -or $_ -eq \"UninstallString\" }\r\n\r\n        ForEach ($Match in $MatchedValues)\r\n\r\n        {\r\n\r\n            #RegEx that matches values containing .exe with a space in the exe path and no double quote encapsulation\r\n\r\n            $ValueRegEx = '(^(?!\\u0022).*\\s.*\\.[Ee][Xx][Ee](?&lt;!\\u0022))(.*$)'\r\n\r\n            $Value = $ParentKey.GetValue($Match)\r\n\r\n            #Test if value matches RegEx\r\n\r\n            If ($Value -match $ValueRegEx)\r\n\r\n            {\r\n\r\n                $RegType = $ParentKey.GetValueKind($Match)\r\n\r\n                #Uses the matches from the RegEx to build a new entry encapsulating the exe path with double quotes\r\n\r\n                $Correction = \"$([char]34)$($Matches[1])$([char]34)$($Matches[2])\"\r\n\r\n                #Attempt to correct the entry\r\n\r\n                Try { $ParentKey.SetValue(\"$Match\", \"$Correction\", [Microsoft.Win32.RegistryValueKind]::$RegType) }\r\n\r\n                Catch { Write-Debug \"Unable to write to $ParentKey\" }\r\n\r\n                #Add a hashtable containing details of corrected key to ArrayList\r\n\r\n                $Values.Add((New-Object PSObject -Property @{\r\n\r\n                \"Name\" = $Match\r\n\r\n                \"Type\" = $RegType\r\n\r\n                \"Value\" = $Value\r\n\r\n                \"Correction\" = $Correction\r\n\r\n                \"ParentKey\" = \"HKEY_LOCAL_MACHINE\\$RegKey\"\r\n\r\n                })) | Out-Null\r\n\r\n            }\r\n\r\n        }\r\n\r\n    }\r\n\r\n    $ParentKey.Close()\r\n\r\n}\r\n\r\n$Registry.Close()<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Detection Remediation<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7219","post","type-post","status-publish","format-standard","hentry","category-research"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"Detection $i = 0 $BaseKeys = &quot;HKLM:\\System\\CurrentControlSet\\Services&quot;, #Services &quot;HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall&quot;, #32bit Uninstalls &quot;HKLM:\\Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall&quot; #64bit Uninstalls #Blacklist for keys to ignore $BlackList = $Null #Create an ArrayList to store results in $Values = New-Object System.Collections.ArrayList #Discovers all registry keys under the base keys $DiscKeys = Get-ChildItem -Recurse -Directory $BaseKeys -Exclude $BlackList -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Name\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"paris\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/pariswells.com\/blog\/research\/windows-unquoted-service-path-remediation\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.8\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Welcome to Pariswells.com |\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Windows Unquoted Service Path Remediation | Welcome to Pariswells.com\" \/>\n\t\t<meta property=\"og:description\" content=\"Detection $i = 0 $BaseKeys = &quot;HKLM:\\System\\CurrentControlSet\\Services&quot;, #Services &quot;HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall&quot;, #32bit Uninstalls &quot;HKLM:\\Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall&quot; #64bit Uninstalls #Blacklist for keys to ignore $BlackList = $Null #Create an ArrayList to store results in $Values = New-Object System.Collections.ArrayList #Discovers all registry keys under the base keys $DiscKeys = Get-ChildItem -Recurse -Directory $BaseKeys -Exclude $BlackList -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Name\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/pariswells.com\/blog\/research\/windows-unquoted-service-path-remediation\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2023-08-15T06:18:21+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2023-08-15T06:18:22+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Windows Unquoted Service Path Remediation | Welcome to Pariswells.com\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Detection $i = 0 $BaseKeys = &quot;HKLM:\\System\\CurrentControlSet\\Services&quot;, #Services &quot;HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall&quot;, #32bit Uninstalls &quot;HKLM:\\Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall&quot; #64bit Uninstalls #Blacklist for keys to ignore $BlackList = $Null #Create an ArrayList to store results in $Values = New-Object System.Collections.ArrayList #Discovers all registry keys under the base keys $DiscKeys = Get-ChildItem -Recurse -Directory $BaseKeys -Exclude $BlackList -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Name\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/windows-unquoted-service-path-remediation#article\",\"name\":\"Windows Unquoted Service Path Remediation | Welcome to Pariswells.com\",\"headline\":\"Windows Unquoted Service Path Remediation\",\"author\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#organization\"},\"datePublished\":\"2023-08-15T06:18:21+00:00\",\"dateModified\":\"2023-08-15T06:18:22+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/windows-unquoted-service-path-remediation#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/windows-unquoted-service-path-remediation#webpage\"},\"articleSection\":\"Research\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/windows-unquoted-service-path-remediation#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/pariswells.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/category\\\/research#listItem\",\"name\":\"Research\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/category\\\/research#listItem\",\"position\":2,\"name\":\"Research\",\"item\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/category\\\/research\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/windows-unquoted-service-path-remediation#listItem\",\"name\":\"Windows Unquoted Service Path Remediation\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/windows-unquoted-service-path-remediation#listItem\",\"position\":3,\"name\":\"Windows Unquoted Service Path Remediation\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/category\\\/research#listItem\",\"name\":\"Research\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#organization\",\"name\":\"Welcome to Pariswells.com\",\"url\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\",\"url\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris\",\"name\":\"paris\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/windows-unquoted-service-path-remediation#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/93b8ee3f592ac401167f870452bd82d43de80152cd3524e2853403658ada9984?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"paris\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/windows-unquoted-service-path-remediation#webpage\",\"url\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/windows-unquoted-service-path-remediation\",\"name\":\"Windows Unquoted Service Path Remediation | Welcome to Pariswells.com\",\"description\":\"Detection $i = 0 $BaseKeys = \\\"HKLM:\\\\System\\\\CurrentControlSet\\\\Services\\\", #Services \\\"HKLM:\\\\Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Uninstall\\\", #32bit Uninstalls \\\"HKLM:\\\\Software\\\\Wow6432Node\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Uninstall\\\" #64bit Uninstalls #Blacklist for keys to ignore $BlackList = $Null #Create an ArrayList to store results in $Values = New-Object System.Collections.ArrayList #Discovers all registry keys under the base keys $DiscKeys = Get-ChildItem -Recurse -Directory $BaseKeys -Exclude $BlackList -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Name\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/windows-unquoted-service-path-remediation#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\"},\"datePublished\":\"2023-08-15T06:18:21+00:00\",\"dateModified\":\"2023-08-15T06:18:22+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/\",\"name\":\"Welcome to Pariswells.com\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Windows Unquoted Service Path Remediation | Welcome to Pariswells.com","description":"Detection $i = 0 $BaseKeys = \"HKLM:\\System\\CurrentControlSet\\Services\", #Services \"HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\", #32bit Uninstalls \"HKLM:\\Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\" #64bit Uninstalls #Blacklist for keys to ignore $BlackList = $Null #Create an ArrayList to store results in $Values = New-Object System.Collections.ArrayList #Discovers all registry keys under the base keys $DiscKeys = Get-ChildItem -Recurse -Directory $BaseKeys -Exclude $BlackList -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Name","canonical_url":"https:\/\/pariswells.com\/blog\/research\/windows-unquoted-service-path-remediation","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/pariswells.com\/blog\/research\/windows-unquoted-service-path-remediation#article","name":"Windows Unquoted Service Path Remediation | Welcome to Pariswells.com","headline":"Windows Unquoted Service Path Remediation","author":{"@id":"https:\/\/pariswells.com\/blog\/author\/paris#author"},"publisher":{"@id":"https:\/\/pariswells.com\/blog\/#organization"},"datePublished":"2023-08-15T06:18:21+00:00","dateModified":"2023-08-15T06:18:22+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/pariswells.com\/blog\/research\/windows-unquoted-service-path-remediation#webpage"},"isPartOf":{"@id":"https:\/\/pariswells.com\/blog\/research\/windows-unquoted-service-path-remediation#webpage"},"articleSection":"Research"},{"@type":"BreadcrumbList","@id":"https:\/\/pariswells.com\/blog\/research\/windows-unquoted-service-path-remediation#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/pariswells.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/category\/research#listItem","name":"Research"}},{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/category\/research#listItem","position":2,"name":"Research","item":"https:\/\/pariswells.com\/blog\/category\/research","nextItem":{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/research\/windows-unquoted-service-path-remediation#listItem","name":"Windows Unquoted Service Path Remediation"},"previousItem":{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/research\/windows-unquoted-service-path-remediation#listItem","position":3,"name":"Windows Unquoted Service Path Remediation","previousItem":{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/category\/research#listItem","name":"Research"}}]},{"@type":"Organization","@id":"https:\/\/pariswells.com\/blog\/#organization","name":"Welcome to Pariswells.com","url":"https:\/\/pariswells.com\/blog\/"},{"@type":"Person","@id":"https:\/\/pariswells.com\/blog\/author\/paris#author","url":"https:\/\/pariswells.com\/blog\/author\/paris","name":"paris","image":{"@type":"ImageObject","@id":"https:\/\/pariswells.com\/blog\/research\/windows-unquoted-service-path-remediation#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/93b8ee3f592ac401167f870452bd82d43de80152cd3524e2853403658ada9984?s=96&d=mm&r=g","width":96,"height":96,"caption":"paris"}},{"@type":"WebPage","@id":"https:\/\/pariswells.com\/blog\/research\/windows-unquoted-service-path-remediation#webpage","url":"https:\/\/pariswells.com\/blog\/research\/windows-unquoted-service-path-remediation","name":"Windows Unquoted Service Path Remediation | Welcome to Pariswells.com","description":"Detection $i = 0 $BaseKeys = \"HKLM:\\System\\CurrentControlSet\\Services\", #Services \"HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\", #32bit Uninstalls \"HKLM:\\Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\" #64bit Uninstalls #Blacklist for keys to ignore $BlackList = $Null #Create an ArrayList to store results in $Values = New-Object System.Collections.ArrayList #Discovers all registry keys under the base keys $DiscKeys = Get-ChildItem -Recurse -Directory $BaseKeys -Exclude $BlackList -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Name","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/pariswells.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/pariswells.com\/blog\/research\/windows-unquoted-service-path-remediation#breadcrumblist"},"author":{"@id":"https:\/\/pariswells.com\/blog\/author\/paris#author"},"creator":{"@id":"https:\/\/pariswells.com\/blog\/author\/paris#author"},"datePublished":"2023-08-15T06:18:21+00:00","dateModified":"2023-08-15T06:18:22+00:00"},{"@type":"WebSite","@id":"https:\/\/pariswells.com\/blog\/#website","url":"https:\/\/pariswells.com\/blog\/","name":"Welcome to Pariswells.com","inLanguage":"en-US","publisher":{"@id":"https:\/\/pariswells.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Welcome to Pariswells.com |","og:type":"article","og:title":"Windows Unquoted Service Path Remediation | Welcome to Pariswells.com","og:description":"Detection $i = 0 $BaseKeys = &quot;HKLM:\\System\\CurrentControlSet\\Services&quot;, #Services &quot;HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall&quot;, #32bit Uninstalls &quot;HKLM:\\Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall&quot; #64bit Uninstalls #Blacklist for keys to ignore $BlackList = $Null #Create an ArrayList to store results in $Values = New-Object System.Collections.ArrayList #Discovers all registry keys under the base keys $DiscKeys = Get-ChildItem -Recurse -Directory $BaseKeys -Exclude $BlackList -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Name","og:url":"https:\/\/pariswells.com\/blog\/research\/windows-unquoted-service-path-remediation","article:published_time":"2023-08-15T06:18:21+00:00","article:modified_time":"2023-08-15T06:18:22+00:00","twitter:card":"summary","twitter:title":"Windows Unquoted Service Path Remediation | Welcome to Pariswells.com","twitter:description":"Detection $i = 0 $BaseKeys = &quot;HKLM:\\System\\CurrentControlSet\\Services&quot;, #Services &quot;HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall&quot;, #32bit Uninstalls &quot;HKLM:\\Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall&quot; #64bit Uninstalls #Blacklist for keys to ignore $BlackList = $Null #Create an ArrayList to store results in $Values = New-Object System.Collections.ArrayList #Discovers all registry keys under the base keys $DiscKeys = Get-ChildItem -Recurse -Directory $BaseKeys -Exclude $BlackList -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Name"},"aioseo_meta_data":{"post_id":"7219","title":null,"description":null,"keywords":[],"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2023-08-15 00:23:15","updated":"2023-08-15 06:18:24","primary_term":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/pariswells.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/pariswells.com\/blog\/category\/research\" title=\"Research\">Research<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tWindows Unquoted Service Path Remediation\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/pariswells.com\/blog"},{"label":"Research","link":"https:\/\/pariswells.com\/blog\/category\/research"},{"label":"Windows Unquoted Service Path Remediation","link":"https:\/\/pariswells.com\/blog\/research\/windows-unquoted-service-path-remediation"}],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/7219","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/comments?post=7219"}],"version-history":[{"count":2,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/7219\/revisions"}],"predecessor-version":[{"id":7221,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/7219\/revisions\/7221"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=7219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=7219"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=7219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}