Monday, September 21, 2015

Disable Start Menu Win+X Hidden Context-Menu

I was hoping to find a GPO (Group Policy Object) setting to disable the hidden context menu for the Start Menu (a.k.a. Win+X) in Windows 8 / 8.1 / 2012 / 2012 R2. I did find the menu items are shortcuts under C:\Users\AUser\AppData\Local\Microsoft\Windows\WinX under Group1-3 folders. I was able to effectively disable the Win+X Menu by moving the Group 2 and Group 3 folders out - so my public terminal users can't have access to those shortcuts.

I still hope to be WOW'd by a GPO setting some day, but until then...

Here's a PowerShell script I launched on each of my Remote Desktop Sessions hosts to effectively disable the Win+X menu:
#kill start menu right-click context menu
$folder = "C:\Users\Default\AppData\Local\Microsoft\Windows"
mkdir $folder\WinX.org
Move-Item -Path $folder\WinX\group[2-3] -Destination $folder\WinX.org
Formatted for web with http://codeformatter.blogspot.com/ 

Before:





Ran the script:

After a log-off and back in (my user profiles are non-persistent):



Note: If you have existing persistent user profiles, you'll need to go through each profile and remove the Group# folder you're targeting. If you need to update all users, here's that script too - you're welcome.

$users = (Get-ChildItem C:\Users -Directory -Exclude "Public", "Administrator").FullName
foreach ($user in $users) {
 $folder = "$($user)\AppData\Local\Microsoft\Windows"
 mkdir $folder\WinX.org
 Move-Item -Path $folder\WinX\group[2-3] -Destination $folder\WinX.org
}
Formatted for web with http://codeformatter.blogspot.com/ 



No comments: