From 73eabbff59964ef0386c014e5256d33981211f1a Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sat, 17 Aug 2024 07:17:04 +0530 Subject: [PATCH] Remove WPA check Already present in activation scripts --- MAS/Separate-Files-Version/Troubleshoot.cmd | 47 --------------------- 1 file changed, 47 deletions(-) diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index 72b7b2c..27070aa 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -613,15 +613,6 @@ call :dk_color %Red% "tokens.dat file not found." echo tokens.dat file: [%token%] ) -echo: -set wpainfo= -for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':wpatest\:.*';iex ($f[1]);" %nul6%') do (set wpainfo=%%a) -echo "%wpainfo%" | find /i "Error Found" %nul% && ( -call :dk_color %Red% "WPA Registry Error: %wpainfo%" -) || ( -echo WPA Registry Count: %wpainfo% -) - set tokenstore= for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b" @@ -1109,44 +1100,6 @@ exit /b ::======================================================================================================================================== -:: This code checks for invalid registry keys in HKLM\SYSTEM\WPA. This issue may appear even on healthy systems - -:wpatest: -$wpaKey = [Microsoft.Win32.RegistryKey]::OpenBaseKey('LocalMachine', 'Registry64').OpenSubKey("SYSTEM\\WPA") -$count = $wpaKey.SubKeyCount - -$osVersion = [System.Environment]::OSVersion.Version -$minBuildNumber = 14393 - -if ($osVersion.Build -ge $minBuildNumber) { - $subkeyHashTable = @{} - foreach ($subkeyName in $wpaKey.GetSubKeyNames()) { - $keyNumber = $subkeyName -replace '.*-', '' - $subkeyHashTable[$keyNumber] = $true - } - for ($i=1; $i -le $count; $i++) { - if (-not $subkeyHashTable.ContainsKey("$i")) { - Write-Host "Total Keys $count. Error Found- $i key does not exist" - $wpaKey.Close() - exit - } - } -} -$wpaKey.GetSubKeyNames() | ForEach-Object { - $subkey = $wpaKey.OpenSubKey($_) - $p = $subkey.GetValueNames() - if (($p | Where-Object { $subkey.GetValueKind($_) -eq [Microsoft.Win32.RegistryValueKind]::Binary }).Count -eq 0) { - Write-Host "Total Keys $count. Error Found- Binary Data is corrupt" - $wpaKey.Close() - exit - } -} -$count -$wpaKey.Close() -:wpatest: - -::======================================================================================================================================== - :checkperms set permerror=