# # this script loads a tile layout for the # start menu with NO tiles at all! # ( = deletes all tiles ) # $LAYOUT='C:\Windows\StartLayout.xml' write-host '#######',(split-path $PSCommandPath -Leaf),'#######' echo "delete layout file if it already exists ..." If(Test-Path $LAYOUT) { Remove-Item $LAYOUT } echo "create a blank layout file [ $LAYOUT ] ..." echo "" > $LAYOUT echo " " >> $LAYOUT echo " " >> $LAYOUT echo " " >> $LAYOUT echo " " >> $LAYOUT echo " " >> $LAYOUT echo " " >> $LAYOUT echo "" >> $LAYOUT $regAliases = @("HKLM", "HKCU") # assign the start layout and force it to apply with # "LockedStartLayout" at both the machine and user level ... echo "assign the start layout AND apply it ..." foreach ($regAlias in $regAliases) { $basePath = $regAlias + ":\SOFTWARE\Policies\Microsoft\Windows" $keyPath = $basePath + "\Explorer" IF(!(Test-Path -Path $keyPath)) { New-Item -Path $basePath -Name "Explorer" } Set-ItemProperty -Path $keyPath -Name "LockedStartLayout" -Value 1 Set-ItemProperty -Path $keyPath -Name "StartLayoutFile" -Value "$LAYOUT" } # restart Explorer, open the start menu (necessary to load the new layout), # and give it a few seconds to process ... Start-Sleep -s 3 echo "restart explorer ..." Stop-Process -name explorer Start-Sleep -s 3 $wshell = New-Object -ComObject wscript.shell; $wshell.SendKeys('^{ESCAPE}') Start-Sleep -s 3 # enable the ability to pin items again by disabling "LockedStartLayout" ... foreach ($regAlias in $regAliases) { $basePath = $regAlias + ":\SOFTWARE\Policies\Microsoft\Windows" $keyPath = $basePath + "\Explorer" Set-ItemProperty -Path $keyPath -Name "LockedStartLayout" -Value 0 } # restart Explorer and delete the layout file ... echo "restart explorer ..." Stop-Process -name explorer Remove-Item $LAYOUT write-host '#######',(split-path $PSCommandPath -Leaf),'#######'