From 191121c3d48f445d2be7a7511bdf9bd51832fb3a Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 28 Jul 2024 22:25:36 +0530 Subject: [PATCH] Add more checks in checking user profile SID's --- MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index d65031c..0467fce 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -1103,7 +1103,7 @@ set _sortIds=!_sortIds:PreInstallR_=Retail_! :: https://learn.microsoft.com/office/troubleshoot/activation/reset-office-365-proplus-activation-state set _sidlist= -for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty $('{0}\{1}' -f $p, $_.PSChildName)).ProfileImagePath; if ($pi -like $('{0}\Users\*' -f $Env:SystemDrive)) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a)) +for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($pi -like """"$Env:SystemDrive\Users\*"""" -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_ -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a)) if not defined _sidlist ( set error=1