Skip to content
This repository was archived by the owner on May 28, 2021. It is now read-only.

Commit 2339aa6

Browse files
committed
Add "Hide Recycle Bin From Desktop" + "Show Network On Desktop", reimplements #228 (thx @mcavallo-git)
1 parent 1e8a668 commit 2339aa6

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

Default.preset

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,11 @@ HideSyncNotifications # ShowSyncNotifications
139139
HideRecentShortcuts # ShowRecentShortcuts
140140
SetExplorerThisPC # SetExplorerQuickAccess
141141
HideQuickAccess # ShowQuickAccess
142+
# HideRecycleBinFromDesktop # ShowRecycleBinOnDesktop
142143
ShowThisPCOnDesktop # HideThisPCFromDesktop
143144
# ShowUserFolderOnDesktop # HideUserFolderFromDesktop
144145
# ShowControlPanelOnDesktop # HideControlPanelFromDesktop
146+
# ShowNetworkOnDesktop # HideNetworkFromDesktop
145147
HideDesktopFromThisPC # ShowDesktopInThisPC
146148
# HideDesktopFromExplorer # ShowDesktopInExplorer
147149
HideDocumentsFromThisPC # ShowDocumentsInThisPC

Win10.psm1

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2095,6 +2095,26 @@ Function ShowQuickAccess {
20952095
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" -Name "HubMode" -ErrorAction SilentlyContinue
20962096
}
20972097

2098+
# Hide Recycle Bin shortcut from desktop
2099+
Function HideRecycleBinFromDesktop {
2100+
Write-Output "Hiding Recycle Bin shortcut from desktop..."
2101+
If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu")) {
2102+
New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" -Force | Out-Null
2103+
}
2104+
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" -Name "{645FF040-5081-101B-9F08-00AA002F954E}" -Type DWord -Value 1
2105+
If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel")) {
2106+
New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Force | Out-Null
2107+
}
2108+
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{645FF040-5081-101B-9F08-00AA002F954E}" -Type DWord -Value 1
2109+
}
2110+
2111+
# Show Recycle Bin shortcut on desktop
2112+
Function ShowRecycleBinOnDesktop {
2113+
Write-Output "Showing Recycle Bin shortcut on desktop..."
2114+
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" -Name "{645FF040-5081-101B-9F08-00AA002F954E}" -ErrorAction SilentlyContinue
2115+
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{645FF040-5081-101B-9F08-00AA002F954E}" -ErrorAction SilentlyContinue
2116+
}
2117+
20982118
# Show This PC shortcut on desktop
20992119
Function ShowThisPCOnDesktop {
21002120
Write-Output "Showing This PC shortcut on desktop..."
@@ -2155,6 +2175,26 @@ Function HideControlPanelFromDesktop {
21552175
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}" -ErrorAction SilentlyContinue
21562176
}
21572177

2178+
# Show Network shortcut on desktop
2179+
Function ShowNetworkOnDesktop {
2180+
Write-Output "Showing Network shortcut on desktop..."
2181+
If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" )) {
2182+
New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" -Force | Out-Null
2183+
}
2184+
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" -Name "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" -Type DWord -Value 0
2185+
If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" )) {
2186+
New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Force | Out-Null
2187+
}
2188+
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" -Type DWord -Value 0
2189+
}
2190+
2191+
# Hide Network shortcut from desktop
2192+
Function HideNetworkFromDesktop {
2193+
Write-Output "Hiding Network shortcut from desktop..."
2194+
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" -Name "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" -ErrorAction SilentlyContinue
2195+
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" -ErrorAction SilentlyContinue
2196+
}
2197+
21582198
# Hide Desktop icon from This PC - The icon remains in personal folders and open/save dialogs
21592199
Function HideDesktopFromThisPC {
21602200
Write-Output "Hiding Desktop icon from This PC..."

0 commit comments

Comments
 (0)