Skip to content

Commit

Permalink
fix: hide any redundant errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Xyueta committed Oct 6, 2023
1 parent 4be5631 commit 40dd4ad
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/playbook/Executables/FINALIZE.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ for /f %%a in ('wmic path Win32_NetworkAdapter get GUID ^| findstr "{"') do (

:: Set network adapter driver registry key
for /f %%a in ('wmic path Win32_NetworkAdapter get PNPDeviceID^| findstr /L "PCI\VEN_"') do (
for /f "tokens=3" %%b in ('reg query "HKLM\SYSTEM\CurrentControlSet\Enum\%%a" /v "Driver"') do (
for /f "tokens=3" %%b in ('reg query "HKLM\SYSTEM\CurrentControlSet\Enum\%%a" /v "Driver" 2^>nul') do (
set "netKey=HKLM\SYSTEM\CurrentControlSet\Control\Class\%%b"
)
)
Expand Down Expand Up @@ -133,11 +133,11 @@ for %%a in (
"WoWLANS5Support"
) do (
rem Check without '*'
for /f %%b in ('reg query "!netKey!" /v "%%~a" ^| findstr "HKEY"') do (
for /f %%b in ('reg query "!netKey!" /v "%%~a" 2^>nul ^| findstr "HKEY" 2^>nul') do (
reg add "!netKey!" /v "%%~a" /t REG_SZ /d "0" /f > nul
)
rem Check with '*'
for /f %%b in ('reg query "!netKey!" /v "*%%~a" ^| findstr "HKEY"') do (
for /f %%b in ('reg query "!netKey!" /v "*%%~a" 2^>nul ^| findstr "HKEY" 2^>nul') do (
reg add "!netKey!" /v "*%%~a" /t REG_SZ /d "0" /f > nul
)
)
Expand Down Expand Up @@ -209,7 +209,7 @@ if "!diskDrive!" == "SSD" (
)

:: Detect if user uses laptop device or personal computer
for /f "delims=:{}" %%a in ('wmic path Win32_SystemEnclosure get ChassisTypes ^| findstr [0-9]') do set "CHASSIS=%%a"]
for /f "delims=:{}" %%a in ('wmic path Win32_SystemEnclosure get ChassisTypes ^| findstr [0-9]') do set "CHASSIS=%%a"
set "DEVICE_TYPE=PC"
for %%a in (8 9 10 11 12 13 14 18 21 30 31 32) do if "!CHASSIS!" == "%%a" (set "DEVICE_TYPE=LAPTOP")

Expand Down
4 changes: 2 additions & 2 deletions src/playbook/Executables/STARTMENU.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ copy /y "Layout.xml" "%SystemDrive%\Users\Default\AppData\Local\Microsoft\Window
:: If the "Volatile Environment" key exists, that means it is a proper user. Built in accounts/SIDs don't have this key.
for /f "usebackq tokens=2 delims=\" %%a in (`reg query "HKEY_USERS" ^| findstr /r /x /c:"HKEY_USERS\\S-.*" /c:"HKEY_USERS\\AME_UserHive_[^_]*"`) do (
reg query "HKEY_USERS\%%a" | findstr /c:"Volatile Environment" /c:"AME_UserHive_" > nul && (
for /f "usebackq tokens=4* delims= " %%c in (`reg query "HKU\%%a\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Local AppData" ^| findstr /r /x /c:".*Local AppData[ ]*REG_SZ[ ].*"`) do (
for /f "usebackq tokens=4* delims= " %%c in (`reg query "HKU\%%a\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Local AppData" 2^>nul ^| findstr /r /x /c:".*Local AppData[ ]*REG_SZ[ ].*" 2^>nul`) do (
copy /y "Layout.xml" "%%c\Microsoft\Windows\Shell\LayoutModification.xml" > nul

rem Clear Start Menu pinned items
Expand All @@ -15,7 +15,7 @@ for /f "usebackq tokens=2 delims=\" %%a in (`reg query "HKEY_USERS" ^| findstr /
)
)
)
for /f "usebackq delims=" %%c in (`reg query "HKU\%%a\SOFTWARE\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount" ^| findstr /c:"start.tilegrid"`) do (
for /f "usebackq delims=" %%c in (`reg query "HKU\%%a\SOFTWARE\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount" 2^>nul ^| findstr /c:"start.tilegrid" 2^>nul`) do (
reg delete "%%c" /f > nul 2>&1
)
)
Expand Down
2 changes: 1 addition & 1 deletion src/playbook/Executables/TASKBARPINS.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if exist "%ProgramFiles(x86)%\Microsoft\Edge\Application\msedge.exe" (
:: If the "Volatile Environment" key exists, that means it is a proper user. Built in accounts/SIDs don't have this key.
for /f "usebackq tokens=2 delims=\" %%a in (`reg query "HKEY_USERS" ^| findstr /r /x /c:"HKEY_USERS\\S-.*" /c:"HKEY_USERS\\AME_UserHive_[^_]*"`) do (
reg query "HKEY_USERS\%%a" | findstr /c:"Volatile Environment" /c:"AME_UserHive_" > nul && (
for /f "usebackq tokens=3* delims= " %%b in (`reg query "HKU\%%a\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "AppData" ^| findstr /r /x /c:".*AppData[ ]*REG_SZ[ ].*"`) do (
for /f "usebackq tokens=3* delims= " %%b in (`reg query "HKU\%%a\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "AppData" 2^>nul ^| findstr /r /x /c:".*AppData[ ]*REG_SZ[ ].*" 2^>nul`) do (
rmdir /s /q "%%b\%taskBarLocation%" > nul
mkdir "%%b\%taskBarLocation%" > nul
copy /y "Shortcuts\File Explorer.lnk" "%%b\%taskBarLocation%" > nul
Expand Down

0 comments on commit 40dd4ad

Please sign in to comment.