How to set a Windows Start Menu Layout via PowerShell for the current user on Windows 10

Viewed 3618

Since I had to set up Windows PCs way too often in the last time (and probably will also in the next time) I am working on automating this process as much as I possibly can (even though it still won't be worth it timewise).

Currently I try to erase all items from the start layout. I have seen this post but it states there it only unpins installed applications (some stuff will still be there after executing the script like the Windows Store).

So instead I thought it would be easier to just say Windows "Hey, how about using this empty layout" to remove everything. I followed these both tutorials 1, 2.

I exported my current (empty) start layout via PowerShell:

Export-StartLayout -UseDesktopApplicationID -Path "C:\CustomStartLayout.xml"

It looks like this:

<LayoutModificationTemplate xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout" Version="1" xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification">
    <LayoutOptions StartTileGroupCellWidth="6" />
    <DefaultLayoutOverride>
        <StartLayoutCollection>
            <defaultlayout:StartLayout GroupCellWidth="6" />
        </StartLayoutCollection>
    </DefaultLayoutOverride>
</LayoutModificationTemplate>

Then I created the registry entries as they are in both tutorials:

New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer"
New-ItemProperty -Force -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name LockedStartLayout -PropertyType DWord -Value 0
New-ItemProperty -Force -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name StartLayoutFile -PropertyType ExpandString -Value "C:\CustomStartLayout.xml"

It states that the changes should take effect after restarting Windows, but they don't. I already checked whether the registry keys are in the registry with correct values at the correct path and that the xml file is at the correct path.

Am I missing something? Or is there another approach? It is important that I just have to execute the script in the end and that I do not have to interfere with anything manually. Manual steps should only be initial (like writing this script or creating a standard layout file which will later be loaded in).

1 Answers

So I did a bit of research. Apparently it is somehow special to apply a start layout to a user that is currently logged in (because this is not needed often and only applies to one single user).

The above solution in my question only works for users that did not log into the system on this computer yet - not even once (I did not test it with a new created user. I just know my PC didn't explode after running these commands).

From this post and this post I now know that the default configuration of the start layout lies at:

C:\Users\%username%\AppData\Local\Microsoft\Windows\Shell\DefaultLayout.xml

And also that this one should not be changed. For modifications use the following file (if it is not present yet just create it):

C:\Users\%username%\AppData\Local\Microsoft\Windows\Shell\LayoutModification.xml

But this file will only take effect after deleting a specific registry item. Here is how you do it in PowerShell:

Remove-Item -Force -Recurse -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CloudStore\Store"

Of course the PC has to be restarted afterwards.

Related