mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2025-11-17 02:56:17 +00:00
Added option to change the location that File Explorer opens to (#133)
This commit is contained in:
4
Get.ps1
4
Get.ps1
@@ -33,6 +33,10 @@ param (
|
|||||||
[switch]$RevertContextMenu,
|
[switch]$RevertContextMenu,
|
||||||
[switch]$HideHome,
|
[switch]$HideHome,
|
||||||
[switch]$HideGallery,
|
[switch]$HideGallery,
|
||||||
|
[switch]$ExplorerToHome,
|
||||||
|
[switch]$ExplorerToThisPC,
|
||||||
|
[switch]$ExplorerToDownloads,
|
||||||
|
[switch]$ExplorerToOneDrive,
|
||||||
[switch]$DisableOnedrive, [switch]$HideOnedrive,
|
[switch]$DisableOnedrive, [switch]$HideOnedrive,
|
||||||
[switch]$Disable3dObjects, [switch]$Hide3dObjects,
|
[switch]$Disable3dObjects, [switch]$Hide3dObjects,
|
||||||
[switch]$DisableMusic, [switch]$HideMusic,
|
[switch]$DisableMusic, [switch]$HideMusic,
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ Bing, Copilot & More
|
|||||||
- Disable Windows Recall snapshots. (Windows 11 only)
|
- Disable Windows Recall snapshots. (Windows 11 only)
|
||||||
|
|
||||||
File Explorer
|
File Explorer
|
||||||
|
- Change the default location that File Explorer opens to.
|
||||||
- Show hidden files, folders & drives.
|
- Show hidden files, folders & drives.
|
||||||
- Show file extensions for known file types.
|
- Show file extensions for known file types.
|
||||||
- Hide the gallery section from the File Explorer sidepanel. (Windows 11 only)
|
- Hide the gallery section from the File Explorer sidepanel. (Windows 11 only)
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ The script also includes many features that system administrators will enjoy. Su
|
|||||||
|
|
||||||
#### File Explorer
|
#### File Explorer
|
||||||
|
|
||||||
|
- Change the default location that File Explorer opens to.
|
||||||
- Show hidden files, folders and drives.
|
- Show hidden files, folders and drives.
|
||||||
- Show file extensions for known file types.
|
- Show file extensions for known file types.
|
||||||
- Hide the Home or Gallery section from the File Explorer navigation pane. (Windows 11 only)
|
- 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) |
|
| -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) |
|
| -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) |
|
| -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) |
|
| -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) |
|
| -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) |
|
| -HideMusic | Hide the music folder under 'This pc' in File Explorer. (Windows 10 only) |
|
||||||
|
|||||||
4
Regfiles/Launch_File_Explorer_To_Downloads.reg
Normal file
4
Regfiles/Launch_File_Explorer_To_Downloads.reg
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Windows Registry Editor Version 5.00
|
||||||
|
|
||||||
|
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
|
||||||
|
"LaunchTo"=dword:00000003
|
||||||
4
Regfiles/Launch_File_Explorer_To_Home.reg
Normal file
4
Regfiles/Launch_File_Explorer_To_Home.reg
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Windows Registry Editor Version 5.00
|
||||||
|
|
||||||
|
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
|
||||||
|
"LaunchTo"=dword:00000002
|
||||||
4
Regfiles/Launch_File_Explorer_To_OneDrive.reg
Normal file
4
Regfiles/Launch_File_Explorer_To_OneDrive.reg
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Windows Registry Editor Version 5.00
|
||||||
|
|
||||||
|
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
|
||||||
|
"LaunchTo"=dword:00000004
|
||||||
4
Regfiles/Launch_File_Explorer_To_This_PC.reg
Normal file
4
Regfiles/Launch_File_Explorer_To_This_PC.reg
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Windows Registry Editor Version 5.00
|
||||||
|
|
||||||
|
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
|
||||||
|
"LaunchTo"=dword:00000001
|
||||||
4
Regfiles/Sysprep/Launch_File_Explorer_To_Downloads.reg
Normal file
4
Regfiles/Sysprep/Launch_File_Explorer_To_Downloads.reg
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Windows Registry Editor Version 5.00
|
||||||
|
|
||||||
|
[hkey_users\default\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
|
||||||
|
"LaunchTo"=dword:00000003
|
||||||
4
Regfiles/Sysprep/Launch_File_Explorer_To_Home.reg
Normal file
4
Regfiles/Sysprep/Launch_File_Explorer_To_Home.reg
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Windows Registry Editor Version 5.00
|
||||||
|
|
||||||
|
[hkey_users\default\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
|
||||||
|
"LaunchTo"=dword:00000002
|
||||||
4
Regfiles/Sysprep/Launch_File_Explorer_To_OneDrive.reg
Normal file
4
Regfiles/Sysprep/Launch_File_Explorer_To_OneDrive.reg
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Windows Registry Editor Version 5.00
|
||||||
|
|
||||||
|
[hkey_users\default\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
|
||||||
|
"LaunchTo"=dword:00000004
|
||||||
4
Regfiles/Sysprep/Launch_File_Explorer_To_This_PC.reg
Normal file
4
Regfiles/Sysprep/Launch_File_Explorer_To_This_PC.reg
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Windows Registry Editor Version 5.00
|
||||||
|
|
||||||
|
[hkey_users\default\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
|
||||||
|
"LaunchTo"=dword:00000001
|
||||||
@@ -35,6 +35,10 @@ param (
|
|||||||
[switch]$RevertContextMenu,
|
[switch]$RevertContextMenu,
|
||||||
[switch]$HideHome,
|
[switch]$HideHome,
|
||||||
[switch]$HideGallery,
|
[switch]$HideGallery,
|
||||||
|
[switch]$ExplorerToHome,
|
||||||
|
[switch]$ExplorerToThisPC,
|
||||||
|
[switch]$ExplorerToDownloads,
|
||||||
|
[switch]$ExplorerToOneDrive,
|
||||||
[switch]$DisableOnedrive, [switch]$HideOnedrive,
|
[switch]$DisableOnedrive, [switch]$HideOnedrive,
|
||||||
[switch]$Disable3dObjects, [switch]$Hide3dObjects,
|
[switch]$Disable3dObjects, [switch]$Hide3dObjects,
|
||||||
[switch]$DisableMusic, [switch]$HideMusic,
|
[switch]$DisableMusic, [switch]$HideMusic,
|
||||||
@@ -1048,6 +1052,35 @@ if ((-not $global:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or ($SPP
|
|||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
if ($( Read-Host -Prompt "Do you want to make any changes to File Explorer? (y/n)" ) -eq 'y') {
|
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 ""
|
Write-Output ""
|
||||||
|
|
||||||
if ($( Read-Host -Prompt " Show hidden files, folders and drives? (y/n)" ) -eq 'y') {
|
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"
|
RegImport "> Hiding the gallery section from the File Explorer navigation pane..." "Hide_Gallery_from_Explorer.reg"
|
||||||
continue
|
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' {
|
'HideDupliDrive' {
|
||||||
RegImport "> Hiding duplicate removable drive entries from the File Explorer navigation pane..." "Hide_duplicate_removable_drives_from_navigation_pane_of_File_Explorer.reg"
|
RegImport "> Hiding duplicate removable drive entries from the File Explorer navigation pane..." "Hide_duplicate_removable_drives_from_navigation_pane_of_File_Explorer.reg"
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user