In my last post I wrote about how to make Internet Explorer the default web browser in Windows 10, now I will cover how to deploy a customized Start Menu during deployment and add a menu item for Internet Explorer the last took a while to figure out how to add the shortcut to Internet Explorer. There are many more ways to customize the Start Menu, deploy it as a mandatory Start Menu using Group Policies in that case the user cannot modify it.
Update 20160412: The IE shortcut is removed from the file system when upgrading to the next Windows 10 release, investigating why.
Let’s start with the basic information, the default Start Menu template is located here:
C:\Users\%username%\AppData\Local\Microsoft\Windows\Shell\DefaultLayouts.xml this file should not be modified. To modify the start menu we use file called LayoutModification.xml that should reside in the same directory. This file can be used in many ways for OEM’s to add icons to the Start Menu or for us IT-Pro to override the default Start Menu. More information on how to use these files can be found here on MSDN: https://msdn.microsoft.com/en-us/library/windows/hardware/mt171092(v=vs.85).aspx
Exporting a customized Start Menu layout
To export the Start Menu we start by using a computer and a user and adjust the Start Menu on that computer so it looks the way we want it.
Then we use Powershell to export a customized start menu using the following command, Export-Startlayout –path C:\Windows\Temp\Startmenu.xml
Then we have a .xml file with our current Start Menu Layout that looks like below that will override the default start menu defined in the DefaultLayouts.xml in Windows 10.
Import a Start Menu layout using Powershell
Now that we have an exported Start Menu we can import it using Powershell. All users that log on to the machine the first time will get this Start Menu layout that you import.
Import-StartLayout –LayoutPath C:\Windows\Temp\Startmenu.xml -MountPath $env:SystemDrive\
After the command is successfully completed the Layoutmodification.xml file is created here: C:\Users\Default\AppData\Local\Microsoft\Windows\Shell\Layoutmodification.xml
When we log on to the computer as a “new” user that haven’t logged on the computer before we get the newly imported Start Menu as shown below.
But wait, where did the Internet Explorer icon that we added before go?
Solving the Internet Explorer icon issue
When we export the file above it exports the Internet Explorers ApplicationID in the .xml file. This will fail when you import it as the Internet Explorer icon doesn’t exist in the users Start Menu folder or as an application during when the Start Menu is imported. It doesn’t exist in the Default start menu folder either and it is not present as an ApplicationID when the Start Menu is imported and therefor it will not show up in the users Start Menu.
To solve this we need to do two things, add a .lnk file that points to Internet Explorer somewhere that all end-users can reach it. I will create it in C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories
Then we need to change the information in the exported .xml file as well. The following line in the .xml file needs to be replaced with a pointer to the .lnk file instead of the ApplicationID.
So we replace it with the following line instead, using the DesktopApplicationLinkPath instead and pointing to the Internet Explorer.lnk file we created before.
DesktopApplicationLinkPath=”%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Accessories\Internet Explorer.lnk”
****Update: As per requested a sample file can be downloaded here with Office 2013 and the IE shortcut: StartMenu.xml****
If we then log on as a new user once again we get the Internet Explorer icon on the Start Menu as well as intended.
Applying the Start Menu during OS deployment
To deploy this I have written a simple Powershell script that imports the StartMenu.xml file and copies the Internet Explorer link we created before.
The Powershell Script content:
Import-StartLayout -LayoutPath $PSScriptRoot\StartMenu.xml -MountPath $env:SystemDrive\
Copy-Item -Path $PSScriptRoot'\Internet Explorer.lnk' -Destination $env:SystemDrive'\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories'
Then you are ready to test the deployment of a customized start menu including an Internet Explorer icon.