Skip to content

Commit

Permalink
feat: hide any redundant errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Xyueta committed Oct 8, 2023
1 parent 7c580b6 commit de22aa6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/playbook/Executables/CONVERTUSERS.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions src/playbook/Executables/ONED.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
2 changes: 1 addition & 1 deletion src/playbook/Executables/WIN11.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit de22aa6

Please sign in to comment.