From 3321781b3163ec7be3b29696944441a18ccbca02 Mon Sep 17 00:00:00 2001 From: Raphire <9938813+Raphire@users.noreply.github.com> Date: Sun, 15 Oct 2023 19:48:27 +0200 Subject: [PATCH] New option to hide duplicate removable drive entries from windows explorer --- Menus/Info.txt | 1 + README.md | 2 + ..._from_navigation_pane_of_File_Explorer.reg | Bin 0 -> 376 bytes ..._from_navigation_pane_of_File_Explorer.reg | Bin 0 -> 414 bytes Win11Debloat.ps1 | 52 +++++++----------- 5 files changed, 24 insertions(+), 31 deletions(-) create mode 100644 Regfiles/Hide_duplicate_removable_drives_from_navigation_pane_of_File_Explorer.reg create mode 100644 Regfiles/Undo/Show_duplicate_removable_drives_from_navigation_pane_of_File_Explorer.reg diff --git a/Menus/Info.txt b/Menus/Info.txt index 60696e0..fc524f4 100644 --- a/Menus/Info.txt +++ b/Menus/Info.txt @@ -28,6 +28,7 @@ through all the settings yourself, or removing apps one by one! - Disable tips, tricks, suggestions and ads in start, settings, notifications, windows explorer, and on the lockscreen. - Show hidden files, folders and drives. - Show file extensions for known file types. +- Hide duplicate removable drive entries from the windows explorer navigation pane, so only the entry under 'This PC' remains. - Remove all pinned apps from the start menu. NOTE: This applies to all existing and new users. (Windows 11 update 22H2 or later only) - Align taskbar icons to the left. (Windows 11 only) - Hide or change the search icon/box on the taskbar. (Windows 11 only) diff --git a/README.md b/README.md index 665f225..d62d7da 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ In this mode you'll be able to make any of the following changes: - Disable tips, tricks, suggestions and ads in start, settings, notifications, windows explorer, and on the lockscreen. - Show hidden files, folders and drives. - Show file extensions for known file types. +- Hide duplicate removable drive entries from the windows explorer navigation pane, so only the entry under 'This PC' remains. - Remove all pinned apps from the start menu. NOTE: This applies to all existing and new users. (Windows 11 update 22H2 or later only) - Align taskbar icons to the left. (Windows 11 only) - Hide or change the search icon/box on the taskbar. (Windows 11 only) @@ -79,6 +80,7 @@ To run the script without any user input, simply add parameters at the end, exam | -DisableSuggestions | Disable tips, tricks, suggestions and ads in start, settings, notifications and windows explorer. | | -ShowHiddenFolders | Show hidden files, folders and drives. | | -ShowKnownFileExt | Show file extensions for known file types. | +| -HideDupliDrive | Hide duplicate removable drive entries from the windows explorer navigation pane, so only the entry under 'This PC' remains. | | -TaskbarAlignLeft | Align taskbar icons to the left. (Windows 11 only) | | -HideSearchTb | Hide search icon from the taskbar. (Windows 11 only) | | -ShowSearchIconTb | Show search icon on the taskbar. (Windows 11 only) | diff --git a/Regfiles/Hide_duplicate_removable_drives_from_navigation_pane_of_File_Explorer.reg b/Regfiles/Hide_duplicate_removable_drives_from_navigation_pane_of_File_Explorer.reg new file mode 100644 index 0000000000000000000000000000000000000000..9b96ecc0f0a75b8296db0b1ca770ca6a61febbdc GIT binary patch literal 376 zcmY+A-Acni5QV>M!FT8jM69*7w>2gx+6t|-h+9h0T7oetNkv6`b@elPp)9*IbI$yn z+0Ty|83lKgJX6zR%!;*G&6bK+kwi8#DveuA*DSc; zl9+*Z!B88^oiUOPOyp9on2C=YWN6o0yO;Jaxp!ue{i`q7;mM3j6@~nNHNh?~Y{(m} z-#P;)X4X73`ZvZSmOP40%v(Bb^_!FHtwpxl)cV}5e>M%giFCck960~T6S;9>lgy}GjqvfrG8;NV9H!m0 z`gdsSb!pPkZ)ig++GYj59V-LhCLi2Xe{{$J_3EeR&U$w4trHV}v#07*WUac+H$=il AhyVZp literal 0 HcmV?d00001 diff --git a/Win11Debloat.ps1 b/Win11Debloat.ps1 index 7ff2864..e0d51bf 100644 --- a/Win11Debloat.ps1 +++ b/Win11Debloat.ps1 @@ -16,6 +16,7 @@ param [Parameter(ValueFromPipeline = $true)][switch]$DisableSuggestions, [Parameter(ValueFromPipeline = $true)][switch]$ShowHiddenFolders, [Parameter(ValueFromPipeline = $true)][switch]$ShowKnownFileExt, + [Parameter(ValueFromPipeline = $true)][switch]$HideDupliDrive, [Parameter(ValueFromPipeline = $true)][switch]$TaskbarAlignLeft, [Parameter(ValueFromPipeline = $true)][switch]$HideSearchTb, [Parameter(ValueFromPipeline = $true)][switch]$ShowSearchIconTb, @@ -76,6 +77,8 @@ function RemoveApps { # Remove provisioned app from OS image, so the app won't be installed for any new users Get-AppxProvisionedPackage -Online | Where-Object { $_.PackageName -like $app } | ForEach-Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_.PackageName } } + + Write-Output "" } @@ -89,6 +92,7 @@ function RegImport { Write-Output $Message reg import $path + Write-Output "" } @@ -358,28 +362,34 @@ if ((-not $PSBoundParameters.Count) -or $RunDefaults -or $RunWin11Defaults -or ( if ($( Read-Host -Prompt " Show file extensions for known file types? (y/n)" ) -eq 'y') { $PSBoundParameters.Add('ShowKnownFileExt', $ShowKnownFileExt) } + + Write-Output "" + + if ($( Read-Host -Prompt " Hide duplicate removable drive entries from the windows explorer sidepane so they only show under 'This PC'? (y/n)" ) -eq 'y') { + $PSBoundParameters.Add('HideDupliDrive', $HideDupliDrive) + } } # Only show option for disabling these specific folders for windows 10 users if (get-ciminstance -query "select caption from win32_operatingsystem where caption like '%Windows 10%'"){ Write-Output "" - if ($( Read-Host -Prompt "Do you want to hide any folders from the windows explorer sidepanel? (y/n)" ) -eq 'y') { + if ($( Read-Host -Prompt "Do you want to hide any folders from the windows explorer sidepane? (y/n)" ) -eq 'y') { Write-Output "" - if ($( Read-Host -Prompt " Hide the onedrive folder in windows explorer? (y/n)" ) -eq 'y') { + if ($( Read-Host -Prompt " Hide the onedrive folder from the windows explorer sidepane? (y/n)" ) -eq 'y') { $PSBoundParameters.Add('HideOnedrive', $HideOnedrive) } Write-Output "" - if ($( Read-Host -Prompt " Hide the 3D objects folder in windows explorer? (y/n)" ) -eq 'y') { + if ($( Read-Host -Prompt " Hide the 3D objects folder from the windows explorer sidepane? (y/n)" ) -eq 'y') { $PSBoundParameters.Add('Hide3dObjects', $Hide3dObjects) } Write-Output "" - if ($( Read-Host -Prompt " Hide the music folder in windows explorer? (y/n)" ) -eq 'y') { + if ($( Read-Host -Prompt " Hide the music folder from the windows explorer sidepane? (y/n)" ) -eq 'y') { $PSBoundParameters.Add('HideMusic', $HideMusic) } } @@ -449,122 +459,102 @@ else { switch ($PSBoundParameters.Keys) { 'RemoveApps' { RemoveApps "$PSScriptRoot/Appslist.txt" "> Removing pre-installed windows apps..." - Write-Output "" continue } 'RemoveGamingApps' { RemoveApps "$PSScriptRoot/GamingAppslist.txt" "> Removing gaming-related windows apps..." - Write-Output "" continue } 'DisableTelemetry' { RegImport "> Disabling telemetry, diagnostic data, app-launch tracking and targeted ads..." $PSScriptRoot\Regfiles\Disable_Telemetry.reg - Write-Output "" continue } {$_ -in "DisableBingSearches", "DisableBing"} { RegImport "> Disabling bing search, bing AI & cortana in windows search..." $PSScriptRoot\Regfiles\Disable_Bing_Cortana_In_Search.reg - Write-Output "" continue } 'DisableLockscreenTips' { RegImport "> Disabling tips & tricks on the lockscreen..." $PSScriptRoot\Regfiles\Disable_Lockscreen_Tips.reg - Write-Output "" continue } {$_ -in "DisableSuggestions", "DisableWindowsSuggestions"} { RegImport "> Disabling tips, tricks, suggestions and ads across Windows..." $PSScriptRoot\Regfiles\Disable_Windows_Suggestions.reg - Write-Output "" continue } 'TaskbarAlignLeft' { RegImport "> Aligning taskbar buttons to the left..." $PSScriptRoot\Regfiles\Align_Taskbar_Left.reg - Write-Output "" continue } 'HideSearchTb' { RegImport "> Hiding the search icon from the taskbar..." $PSScriptRoot\Regfiles\Hide_Search_Taskbar.reg - Write-Output "" continue } 'ShowSearchIconTb' { RegImport "> Changing taskbar search to icon only..." $PSScriptRoot\Regfiles\Show_Search_Icon.reg - Write-Output "" continue } 'ShowSearchLabelTb' { RegImport "> Changing taskbar search to icon with label..." $PSScriptRoot\Regfiles\Show_Search_Icon_And_Label.reg - Write-Output "" continue } 'ShowSearchBoxTb' { RegImport "> Changing taskbar search to search box..." $PSScriptRoot\Regfiles\Show_Search_Box.reg - Write-Output "" continue } 'HideTaskview' { RegImport "> Hiding the taskview button from the taskbar..." $PSScriptRoot\Regfiles\Hide_Taskview_Taskbar.reg - Write-Output "" continue } 'DisableCopilot' { RegImport "> Disabling Windows copilot..." $PSScriptRoot\Regfiles\Disable_Copilot.reg - Write-Output "" continue } {$_ -in "HideWidgets", "DisableWidgets"} { RegImport "> Disabling the widget service and hiding the widget icon from the taskbar..." $PSScriptRoot\Regfiles\Disable_Widgets_Taskbar.reg - Write-Output "" continue } {$_ -in "HideChat", "DisableChat"} { RegImport "> Hiding the chat icon from the taskbar..." $PSScriptRoot\Regfiles\Disable_Chat_Taskbar.reg - Write-Output "" continue } 'ClearStart' { ClearStartMenu "> Removing all pinned apps from the start menu..." - Write-Output "" continue } 'ShowHiddenFolders' { RegImport "> Unhiding hidden files, folders and drives..." $PSScriptRoot\Regfiles\Show_Hidden_Folders.reg - Write-Output "" continue } 'ShowKnownFileExt' { RegImport "> Enabling file extensions for known file types..." $PSScriptRoot\Regfiles\Show_Extensions_For_Known_File_Types.reg - Write-Output "" + continue + } + 'HideDupliDrive' { + RegImport "> Hiding duplicate removable drive entries from the windows explorer navigation pane..." $PSScriptRoot\Regfiles\Hide_duplicate_removable_drives_from_navigation_pane_of_File_Explorer.reg continue } {$_ -in "HideOnedrive", "DisableOnedrive"} { - RegImport "> Hiding the onedrive folder in windows explorer..." $PSScriptRoot\Regfiles\Hide_Onedrive_Folder.reg - Write-Output "" + RegImport "> Hiding the onedrive folder from the windows explorer navigation pane..." $PSScriptRoot\Regfiles\Hide_Onedrive_Folder.reg continue } {$_ -in "Hide3dObjects", "Disable3dObjects"} { - RegImport "> Hiding the 3D objects folder in windows explorer..." $PSScriptRoot\Regfiles\Hide_3D_Objects_Folder.reg - Write-Output "" + RegImport "> Hiding the 3D objects folder from the windows explorer navigation pane..." $PSScriptRoot\Regfiles\Hide_3D_Objects_Folder.reg continue } {$_ -in "HideMusic", "DisableMusic"} { - RegImport "> Hiding the music folder in windows explorer..." $PSScriptRoot\Regfiles\Hide_Music_folder.reg - Write-Output "" + RegImport "> Hiding the music folder from the windows explorer navigation pane..." $PSScriptRoot\Regfiles\Hide_Music_folder.reg continue } {$_ -in "HideIncludeInLibrary", "DisableIncludeInLibrary"} { RegImport "> Hiding 'Include in library' in the context menu..." $PSScriptRoot\Regfiles\Disable_Include_in_library_from_context_menu.reg - Write-Output "" continue } {$_ -in "HideGiveAccessTo", "DisableGiveAccessTo"} { RegImport "> Hiding 'Give access to' in the context menu..." $PSScriptRoot\Regfiles\Disable_Give_access_to_context_menu.reg - Write-Output "" continue } {$_ -in "HideShare", "DisableShare"} { RegImport "> Hiding 'Share' in the context menu..." $PSScriptRoot\Regfiles\Disable_Share_from_context_menu.reg - Write-Output "" continue } }