diff --git a/Get.ps1 b/Get.ps1 index 33e5ced..5bdcc36 100644 --- a/Get.ps1 +++ b/Get.ps1 @@ -33,6 +33,10 @@ param ( [switch]$RevertContextMenu, [switch]$HideHome, [switch]$HideGallery, + [switch]$ExplorerToHome, + [switch]$ExplorerToThisPC, + [switch]$ExplorerToDownloads, + [switch]$ExplorerToOneDrive, [switch]$DisableOnedrive, [switch]$HideOnedrive, [switch]$Disable3dObjects, [switch]$Hide3dObjects, [switch]$DisableMusic, [switch]$HideMusic, diff --git a/Menus/Info b/Menus/Info index 07d20f2..78236a7 100644 --- a/Menus/Info +++ b/Menus/Info @@ -23,6 +23,7 @@ Bing, Copilot & More - Disable Windows Recall snapshots. (Windows 11 only) File Explorer +- Change the default location that File Explorer opens to. - Show hidden files, folders & drives. - Show file extensions for known file types. - Hide the gallery section from the File Explorer sidepanel. (Windows 11 only) diff --git a/README.md b/README.md index fee3c07..18daa89 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ The script also includes many features that system administrators will enjoy. Su #### File Explorer +- Change the default location that File Explorer opens to. - Show hidden files, folders and drives. - Show file extensions for known file types. - Hide the Home or Gallery section from the File Explorer navigation pane. (Windows 11 only) @@ -328,6 +329,10 @@ The quick and advanced usage methods support switch parameters. A table of all t | -DisableRecall | Disable Windows Recall snapshots. (Windows 11 only) | | -HideHome | Hide the home section from the File Explorer navigation pane and add a toggle in the File Explorer folder options. (Windows 11 only) | | -HideGallery | Hide the gallery section from the File Explorer navigation pane and add a toggle in the File Explorer folder options. (Windows 11 only) | +| -ExplorerToHome | Changes the page that File Explorer opens to to `Home` | +| -ExplorerToThisPC | Changes the page that File Explorer opens to to `This PC` | +| -ExplorerToDownloads | Changes the page that File Explorer opens to to `Downloads` | +| -ExplorerToOneDrive | Changes the page that File Explorer opens to to `OneDrive` | | -HideOnedrive | Hide the OneDrive folder from the File Explorer navigation pane. (Windows 10 only) | | -Hide3dObjects | Hide the 3D objects folder under 'This pc' in File Explorer. (Windows 10 only) | | -HideMusic | Hide the music folder under 'This pc' in File Explorer. (Windows 10 only) | diff --git a/Regfiles/Launch_File_Explorer_To_Downloads.reg b/Regfiles/Launch_File_Explorer_To_Downloads.reg new file mode 100644 index 0000000..f54a883 --- /dev/null +++ b/Regfiles/Launch_File_Explorer_To_Downloads.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] +"LaunchTo"=dword:00000003 diff --git a/Regfiles/Launch_File_Explorer_To_Home.reg b/Regfiles/Launch_File_Explorer_To_Home.reg new file mode 100644 index 0000000..fa28b86 --- /dev/null +++ b/Regfiles/Launch_File_Explorer_To_Home.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] +"LaunchTo"=dword:00000002 diff --git a/Regfiles/Launch_File_Explorer_To_OneDrive.reg b/Regfiles/Launch_File_Explorer_To_OneDrive.reg new file mode 100644 index 0000000..838648d --- /dev/null +++ b/Regfiles/Launch_File_Explorer_To_OneDrive.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] +"LaunchTo"=dword:00000004 diff --git a/Regfiles/Launch_File_Explorer_To_This_PC.reg b/Regfiles/Launch_File_Explorer_To_This_PC.reg new file mode 100644 index 0000000..9515a60 --- /dev/null +++ b/Regfiles/Launch_File_Explorer_To_This_PC.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] +"LaunchTo"=dword:00000001 diff --git a/Regfiles/Sysprep/Launch_File_Explorer_To_Downloads.reg b/Regfiles/Sysprep/Launch_File_Explorer_To_Downloads.reg new file mode 100644 index 0000000..b51ca74 --- /dev/null +++ b/Regfiles/Sysprep/Launch_File_Explorer_To_Downloads.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[hkey_users\default\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] +"LaunchTo"=dword:00000003 diff --git a/Regfiles/Sysprep/Launch_File_Explorer_To_Home.reg b/Regfiles/Sysprep/Launch_File_Explorer_To_Home.reg new file mode 100644 index 0000000..9db3779 --- /dev/null +++ b/Regfiles/Sysprep/Launch_File_Explorer_To_Home.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[hkey_users\default\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] +"LaunchTo"=dword:00000002 diff --git a/Regfiles/Sysprep/Launch_File_Explorer_To_OneDrive.reg b/Regfiles/Sysprep/Launch_File_Explorer_To_OneDrive.reg new file mode 100644 index 0000000..9462b09 --- /dev/null +++ b/Regfiles/Sysprep/Launch_File_Explorer_To_OneDrive.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[hkey_users\default\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] +"LaunchTo"=dword:00000004 diff --git a/Regfiles/Sysprep/Launch_File_Explorer_To_This_PC.reg b/Regfiles/Sysprep/Launch_File_Explorer_To_This_PC.reg new file mode 100644 index 0000000..4e75fe5 --- /dev/null +++ b/Regfiles/Sysprep/Launch_File_Explorer_To_This_PC.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[hkey_users\default\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] +"LaunchTo"=dword:00000001 diff --git a/Win11Debloat.ps1 b/Win11Debloat.ps1 index 15b8403..8a65391 100644 --- a/Win11Debloat.ps1 +++ b/Win11Debloat.ps1 @@ -35,6 +35,10 @@ param ( [switch]$RevertContextMenu, [switch]$HideHome, [switch]$HideGallery, + [switch]$ExplorerToHome, + [switch]$ExplorerToThisPC, + [switch]$ExplorerToDownloads, + [switch]$ExplorerToOneDrive, [switch]$DisableOnedrive, [switch]$HideOnedrive, [switch]$Disable3dObjects, [switch]$Hide3dObjects, [switch]$DisableMusic, [switch]$HideMusic, @@ -1048,6 +1052,35 @@ if ((-not $global:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or ($SPP Write-Output "" if ($( Read-Host -Prompt "Do you want to make any changes to File Explorer? (y/n)" ) -eq 'y') { + # Show options for changing the File Explorer default location + Do { + Write-Output "" + Write-Host " Options:" -ForegroundColor Yellow + Write-Host " (n) No change" -ForegroundColor Yellow + Write-Host " (1) Open File Explorer to 'Home'" -ForegroundColor Yellow + Write-Host " (2) Open File Explorer to 'This PC'" -ForegroundColor Yellow + Write-Host " (3) Open File Explorer to 'Downloads'" -ForegroundColor Yellow + Write-Host " (4) Open File Explorer to 'OneDrive'" -ForegroundColor Yellow + $ExplSearchInput = Read-Host " Change the default location that File Explorer opens to? (n/1/2/3/4)" + } + while ($ExplSearchInput -ne 'n' -and $ExplSearchInput -ne '0' -and $ExplSearchInput -ne '1' -and $ExplSearchInput -ne '2' -and $ExplSearchInput -ne '3' -and $ExplSearchInput -ne '4') + + # Select correct taskbar search option based on user input + switch ($ExplSearchInput) { + '1' { + AddParameter 'ExplorerToHome' "Change the default location that File Explorer opens to 'Home'" + } + '2' { + AddParameter 'ExplorerToThisPC' "Change the default location that File Explorer opens to 'This PC'" + } + '3' { + AddParameter 'ExplorerToDownloads' "Change the default location that File Explorer opens to 'Downloads'" + } + '4' { + AddParameter 'ExplorerToOneDrive' "Change the default location that File Explorer opens to 'OneDrive'" + } + } + Write-Output "" if ($( Read-Host -Prompt " Show hidden files, folders and drives? (y/n)" ) -eq 'y') { @@ -1375,6 +1408,22 @@ else { RegImport "> Hiding the gallery section from the File Explorer navigation pane..." "Hide_Gallery_from_Explorer.reg" continue } + 'ExplorerToHome' { + RegImport "> Changing the default location that File Explorer opens to `Home`..." "Launch_File_Explorer_To_Home.reg" + continue + } + 'ExplorerToThisPC' { + RegImport "> Changing the default location that File Explorer opens to `This PC`..." "Launch_File_Explorer_To_This_PC.reg" + continue + } + 'ExplorerToDownloads' { + RegImport "> Changing the default location that File Explorer opens to `Downloads`..." "Launch_File_Explorer_To_Downloads.reg" + continue + } + 'ExplorerToOneDrive' { + RegImport "> Changing the default location that File Explorer opens to `OneDrive`..." "Launch_File_Explorer_To_OneDrive.reg" + continue + } 'HideDupliDrive' { RegImport "> Hiding duplicate removable drive entries from the File Explorer navigation pane..." "Hide_duplicate_removable_drives_from_navigation_pane_of_File_Explorer.reg" continue