From de22aa618695d33a8911002e77a48539cad8c44b Mon Sep 17 00:00:00 2001 From: Xyueta Date: Sun, 8 Oct 2023 16:58:13 +0200 Subject: [PATCH] feat: hide any redundant errors --- src/playbook/Executables/CONVERTUSERS.cmd | 4 ++-- src/playbook/Executables/ONED.cmd | 8 ++++---- src/playbook/Executables/WIN11.cmd | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/playbook/Executables/CONVERTUSERS.cmd b/src/playbook/Executables/CONVERTUSERS.cmd index 3557edf5ee..79215420e0 100644 --- a/src/playbook/Executables/CONVERTUSERS.cmd +++ b/src/playbook/Executables/CONVERTUSERS.cmd @@ -4,8 +4,8 @@ net accounts /maxpwage:unlimited > nul for /f "usebackq delims=" %%a in (`PowerShell -NoP -C "(Get-LocalUser | Where {$_.PrincipalSource -eq 'MicrosoftAccount'}).Name"`) do call :CONVERTUSER "%%a" -for /f "usebackq delims=" %%a in (`reg query "HKLM\SOFTWARE\Microsoft\IdentityStore\LogonCache\Name2Sid" ^| findstr /i /c:"Name2Sid"`) do reg delete "%%a" /f > nul 2>&1 -for /f "usebackq delims=" %%a in (`reg query "HKLM\SOFTWARE\Microsoft\IdentityStore\LogonCache\Sid2Name" ^| findstr /i /c:"Sid2Name"`) do reg delete "%%a" /f > nul 2>&1 +for /f "usebackq delims=" %%a in (`reg query "HKLM\SOFTWARE\Microsoft\IdentityStore\LogonCache\Name2Sid" 2^>nul ^| findstr /i /c:"Name2Sid" 2^>nul`) do reg delete "%%a" /f > nul 2>&1 +for /f "usebackq delims=" %%a in (`reg query "HKLM\SOFTWARE\Microsoft\IdentityStore\LogonCache\Sid2Name" 2^>nul ^| findstr /i /c:"Sid2Name" 2^>nul`) do reg delete "%%a" /f > nul 2>&1 rmdir /q /s "%windir%\System32\config\systemprofile\AppData\Local\Microsoft\Windows\CloudAPCache" > nul 2>&1 diff --git a/src/playbook/Executables/ONED.cmd b/src/playbook/Executables/ONED.cmd index 603e2e3a8d..d0b10cc7d1 100644 --- a/src/playbook/Executables/ONED.cmd +++ b/src/playbook/Executables/ONED.cmd @@ -36,16 +36,16 @@ for /f "tokens=2 delims=\" %%a in ('schtasks /query /fo list /v ^| findstr /c:"\ exit /b :USERREG -for /f "usebackq delims=" %%a in (`reg query "HKU\%~1\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\BannerStore" ^| findstr /i /c:"OneDrive"`) do ( +for /f "usebackq delims=" %%a in (`reg query "HKU\%~1\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\BannerStore" 2^>nul ^| findstr /i /c:"OneDrive" 2^>nul`) do ( reg delete "%%a" /f > nul 2>&1 ) -for /f "usebackq delims=" %%a in (`reg query "HKU\%~1\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers" ^| findstr /i /c:"OneDrive"`) do ( +for /f "usebackq delims=" %%a in (`reg query "HKU\%~1\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers" 2^>nul ^| findstr /i /c:"OneDrive" 2^>nul`) do ( reg delete "%%a" /f > nul 2>&1 ) -for /f "usebackq delims=" %%a in (`reg query "HKU\%~1\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths" ^| findstr /i /c:"OneDrive"`) do ( +for /f "usebackq delims=" %%a in (`reg query "HKU\%~1\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths" 2^>nul ^| findstr /i /c:"OneDrive" 2^>nul`) do ( reg delete "%%a" /f > nul 2>&1 ) -for /f "usebackq delims=" %%a in (`reg query "HKU\%~1\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" ^| findstr /i /c:"OneDrive"`) do ( +for /f "usebackq delims=" %%a in (`reg query "HKU\%~1\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" 2^>nul ^| findstr /i /c:"OneDrive" 2^>nul`) do ( reg delete "%%a" /f > nul 2>&1 ) diff --git a/src/playbook/Executables/WIN11.cmd b/src/playbook/Executables/WIN11.cmd index 48959f8674..0647f95043 100644 --- a/src/playbook/Executables/WIN11.cmd +++ b/src/playbook/Executables/WIN11.cmd @@ -139,7 +139,7 @@ reg add "HKU\%~1\Control Panel\Quick Actions\Control Center\QuickActionsStateCap set "mrtCache=HKEY_USERS\%~1\Software\Classes\Local Settings\MrtCache" echo %~1 | find "_Classes" > nul if errorlevel 1 ( - for /f "tokens=*" %%a in ('reg query "%mrtCache%" /s ^| find /i "%mrtCache%"') do ( + for /f "tokens=*" %%a in ('reg query "%mrtCache%" /s 2^>nul ^| find /i "%mrtCache%" 2^>nul') do ( for /f "tokens=1-2" %%b in ('reg query "%%a" /v * ^| find /i "ShellNewDisplayName_Bmp"') do ( reg add "%%a" /v "%%b %%c" /t REG_SZ /d "" /f > nul )