B
BFRD Gary
Guest
So many people have helped me over the years by posting instructions like this online. It's time I pay it forward. Hopefully this is useful to someone...
I'm very OCD about my Windows 10 setup and I've been working around all of the frustrations in setting up a custom start layout (actually I have a few different ones) for quite some time. The way I do it is cumbersome but it seems to work every time and it's (somewhate) easy to make changes after it's set up. Anyone who has worked with custom start layouts is very aware of how unreliable it is and that it will break every 2-3 new Windows 10 builds. This method works very well with 1803 and I've confirmed it on 1703. Not sure about other versions. I've been avoiding 1809 in my environment so far because all of the problems.
This requires AutoHotKey (AutoHotkey) which is free. Also, I usually scour the internet for custom icon files. I'll mention that in the steps but I won't cover .ico files in this guide as it's easy to find information about that all over the web. Another assumption is that you have a pretty good working knowledge of Group Policy, specifically how to create folders and copy files from a network share with Group Policy Preferences. These Group Policy steps are pretty simple if you're already familiar but are missing a lot of detail if you're new to it.
I've learned a lot of this through trial & error and there's a few educated guesses about requirements, etc. mixed in so cut me some slack if you have a deeper knowledge about something that I mention incorrectly. All I can say is this method works. With that, let's get started...
BACKGROUND & PROBLEMS:
I've been deploying shortcuts to the Public Desktop on the user's machines with group policy preferences for many years. Many of my users move from location to location and I wanted every computer to be standardized so that everything would be familiar when they login to a new computer. This is fairly simple. I just copy ("update") the .lnk or .url files from a network share to C:\Users\Public\Desktop using the "Files" feature in Group Policy Preferences. When Windows 10 came out and I saw the new start menu, I really wanted to push my standardized shortcuts there also.
This seems pretty straightforward (and it was in the early builds of Win10). You're supposed to use Export-StartLayout in powershell to export a .xml file, put that in a network share and then point to it with GP at (Computer or User Configuration)/Policies/Administrative Templates/Start Menu and Taskbar/Start Layout. If you're reading this, you're probably frustrated that it appears that's all you have to do. But, it's extremely buggy & keeps breaking with newer builds of Win10 requiring a ton of workarounds.
A list of things that will not work for one reason or another that I've discovered:
This method addresses each of these problems (and probably a few that I've forgotten about) to get everything in precisely the right format so that the GP Start Layout will work.
Take a minute to cuss out Microsoft for not troubleshooting and making sure that the different teams of programmers are working together. Once that's out of your system, then move on to the next section.
FOLDERS ON NETWORK SHARE, C: DRIVE AND GROUP POLICY PREFERENCES:
Some of my machines (including laptops) aren't always on the network so I don't like to rely on the network share being available. For that reason, I create a folder on the C: drive to dump the files in this guide, .bat files, etc. The initials of my organization are BFRD so I create The following folders (among several others) on the local machine with Group Policy Preferences:
I have corresponding folders on a network share that matches the above folders. For example: \\server\share\Icons, \\server\share\settings, etc. and I use Group Policy to copy ("update") the contents of the folders from the network share to local machine. In the Icons folder, I use *.ico as the source in the GPP so as to only copy the icon files. Likewise, I use *.url in the Shortcuts folder, *.xml in the StartLayouts folder, and *.exe in the Launchers folder.
CREATING .EXE FILES, .LNK FILES AND .ICO FILES:
This is the most tedious part but it's also the most important for reliability. It makes sure that there's .lnk files available for the start layout that point to a corresponding .exe file that's always present whether that software is installed or not. This will ensure that the icon always works. It also gives you a lot of flexibility like launching a website with a particular browser as I describe below. If you want to spend some time with AutoHotKey, you can do all kinds of things with it. For example, I am slowly transitioning from Office 2013 to Office 2016 in my environment but I want a consistent shortcut on the desktop and start menu so I use if/then in the .exe that I created with AutoHotKey for each program (Word, Outlook, etc.) that checks to see if 2016 is available and then launches 2013 if not.
Firefox is in the example but you can create as many as you want. In the Launchers folder on a test machine, I create an AutoHotkey script (.ahk file) that simply has the following two commands:
Before I move on, many of our applications are cloud based and some of them work better in different browsers. As I mentioned in my list of problems above, the Start Layout feature doesn't like .url files. You can add the website at the end of the run command to have it launch that website in that browser. For example:
The first example will launch www.google.com in Firefox and the second one will launch www.google.com in a new Chrome window.
Once you've created your AutoHotKey script and saved it, you have two options. The easy way is simply to right-click on the .ahk file and select "Compile Script". This will create an .exe file that will launch your program. However, this will use the default AutoHotKey icon embedded in the .exe. Instead, I like to use a custom .ico file that I can control so that it's never missing in the Start layout. To extract an .ico file from an .exe, I've used BeCyIconGrabber (BeCyIconGrabber) but I prefer to spend a few minutes to find a higher resolution picture to use as my icon. Once I've downloaded and cropped a picture, I like to use www.icoconverter.com to create the .ico file because it includes multiple resolutions in the same .ico file. I then put this in the C:\BFRD\Icons folder. Once I have the .ico file, I use "Convert .ahk to .exe" (installed with AutoHotKey) because you can embed the custom icon file into the .exe. I save this .exe in the Launchers folder.
TIP: Once I've found the picture that I want to use, I use the Transparency Wizard at Online Image Editor to create a transparent background. Definitely not required for any of this to work but it's a nice touch, especially if you're also going to put it on the desktop.
Now I create a shortcut (.url file) to the new .exe file in the C:\BFRD\Shortcuts folder. This should always use the custom icon that's now embedded in the .exe (if you took that step) but, just to make sure, I also right-click on the shortcut, select "Change icon" and point it to the .ico file that I put in C:\BFRD\Icons. This is probably overkill but it's a quick thing to do and I'm not 100% sure where the Start Layout is grabbing its icon.
After I've done all of the above steps, I copy the new files in the Icons, Shortcuts and Launchers folders into their corresponding folders on the network share. As mentioned in the previous section, I only copy .exe files from the network share to the local machine in the Launchers folder but I store the .ahk files in that folder in the network share. This makes it very easy to make and deploy changes to it in the future.
Now the files are in a central location and they get deployed to the local machine because of the Group Policy Object that I mentioned in the previous section. As I mentioned in the list of problems, the Start Layout feature is only reliable if your shortcuts (.url files) are in the C:\ProgramData\Microsoft\Windows\Start Menu\Programs folder. For that reason, I use Group Policy Preferences to create a folder at "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\BFRD Links" and copy ("update") all of the .lnk files from \\server\share\Shortcuts into it. Optionally, you can also copy those shortcuts to C:\Users\Public\Desktop if you want all of the same shortcuts on the desktop.
CREATING AND EXPORTING THE START LAYOUT AND SETTING IT TO APPLY WITH GROUP POLICY:
Now you're going to create a start layout on a template computer, export it, copy it to a network share and then apply it. Make sure that your template computer is included in the OU where you've assigned the Group Policy Object that you used for all of the settings above and either reboot or run gpupdate /force on that machine to make sure that all of the files are copying correctly. On your template machine, remove all of the default buttons in the start menu that you don't want to deploy and go to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\(optional folder\). Right-click on all of the shortcuts that were copied there by Group Policy and select "Pin to Start". Re-arrange everything to your liking and then use the powershell command "Export-StartLayout" to create the .xml file as detailed at Customize and export Start layout (Windows 10).
Now you have to fix the layout of the .xml file that was broken in 1803. The fix/workaround was posted by Srbishb at Windows 10 loses XML based menu after 1803 upgrade. You simply have to modify the top few lines of the .xml file as Srbishb describes. Put the resulting .xml file in the \\server\share\Settings\StartLayouts folder.
You have two options for the .xml file. As mentioned above, I prefer to copy all of my files to the local machine with Group Policy. I copy it to C:\BFRD\Settings\StartLayouts from the network share and apply it from there but you can apply it directly from the network share if preferred. In either case, in Group Policy, go to (either Computer or User Configuration)\Policies\Administrative Templates\Start Menu and Taskbar\Start Layout and point to the .xml file.
You can and should run gpupdate /force on another machine or on a different user profile on your test machine to make sure that it's working.
MAKING CHANGES IN THE FUTURE:
One of the many glitches in this feature is that if you modify the .xml file without re-naming it, it usually won't apply to an existing user profile. In order to get that to work, you need to copy the .xml file before you make your changes with a new name and then update the reference to it in Group Policy. I just add a date at the end of the filename but you can number it or do something else. Just don't re-use the same filename.
You can modify the AutoHotKey files directly on the network share as long as you're not making any changes to the icon and you don't change the name of the file. Use "Convert .ahk to .exe" after you modify and save the .ahk file and apply the same .ico file that you did when you created the original. On the client machine, once GP copies the .exe, this will only update the .exe file that is the target of the .lnk in the Start Menu. Just make sure that you run through all of these steps above to create a new link, change the name of an existing link, or update the icon of an existing link.
I'd like to include a picture of mine but my account hasn't been verified yet so I can't post links or pics. I'll add it later if possible.
More...
I'm very OCD about my Windows 10 setup and I've been working around all of the frustrations in setting up a custom start layout (actually I have a few different ones) for quite some time. The way I do it is cumbersome but it seems to work every time and it's (somewhate) easy to make changes after it's set up. Anyone who has worked with custom start layouts is very aware of how unreliable it is and that it will break every 2-3 new Windows 10 builds. This method works very well with 1803 and I've confirmed it on 1703. Not sure about other versions. I've been avoiding 1809 in my environment so far because all of the problems.
This requires AutoHotKey (AutoHotkey) which is free. Also, I usually scour the internet for custom icon files. I'll mention that in the steps but I won't cover .ico files in this guide as it's easy to find information about that all over the web. Another assumption is that you have a pretty good working knowledge of Group Policy, specifically how to create folders and copy files from a network share with Group Policy Preferences. These Group Policy steps are pretty simple if you're already familiar but are missing a lot of detail if you're new to it.
I've learned a lot of this through trial & error and there's a few educated guesses about requirements, etc. mixed in so cut me some slack if you have a deeper knowledge about something that I mention incorrectly. All I can say is this method works. With that, let's get started...
BACKGROUND & PROBLEMS:
I've been deploying shortcuts to the Public Desktop on the user's machines with group policy preferences for many years. Many of my users move from location to location and I wanted every computer to be standardized so that everything would be familiar when they login to a new computer. This is fairly simple. I just copy ("update") the .lnk or .url files from a network share to C:\Users\Public\Desktop using the "Files" feature in Group Policy Preferences. When Windows 10 came out and I saw the new start menu, I really wanted to push my standardized shortcuts there also.
This seems pretty straightforward (and it was in the early builds of Win10). You're supposed to use Export-StartLayout in powershell to export a .xml file, put that in a network share and then point to it with GP at (Computer or User Configuration)/Policies/Administrative Templates/Start Menu and Taskbar/Start Layout. If you're reading this, you're probably frustrated that it appears that's all you have to do. But, it's extremely buggy & keeps breaking with newer builds of Win10 requiring a ton of workarounds.
A list of things that will not work for one reason or another that I've discovered:
- It likes .lnk files but not .url files
- If the .exe that the .lnk points to isn't there when the Start Layout Group Policy setting is applied, then that button will never appear in the imported layout even if the software is later installed. This is especially annoying if you're deploying software with Group Policy because the start layout will often be applied before the software is installed.
- Icons aren't reliable
- The .lnk that is referenced in the .xml file only works consistently if it's in the C:\ProgramData\Microsoft\Windows\Start Menu\Programs folder or another folder inside that location.
- For an existing user profile, if you change the master .xml file on the network share hoping that it will be applied, it usually doesn't work. You need to create a new .xml file with your changes and then update the Start Layout setting in GP to point to the new file.
- The format of the .xml file changed several builds ago (16xx maybe?) which meant that the old .xml files wouldn't work in the newer builds of Win10. Creating a new template computer and using Export-StartLayout showed the changes in the .xml file.
- It changed again in 1803 but creating a new template machine but using Export-StartLayout exported the old (pre-1803) format. The fix/workaround was posted by Srbishb at Windows 10 loses XML based menu after 1803 upgrade.
This method addresses each of these problems (and probably a few that I've forgotten about) to get everything in precisely the right format so that the GP Start Layout will work.
Take a minute to cuss out Microsoft for not troubleshooting and making sure that the different teams of programmers are working together. Once that's out of your system, then move on to the next section.
FOLDERS ON NETWORK SHARE, C: DRIVE AND GROUP POLICY PREFERENCES:
Some of my machines (including laptops) aren't always on the network so I don't like to rely on the network share being available. For that reason, I create a folder on the C: drive to dump the files in this guide, .bat files, etc. The initials of my organization are BFRD so I create The following folders (among several others) on the local machine with Group Policy Preferences:
- C:\BFRD (hidden)
- C:\BFRD\Icons
- C:\BFRD\Settings
- C:\BFRD\Settings\StartLayouts
- C:\BFRD\Shortcuts
- C:\BFRD\Shortcuts\Launchers
I have corresponding folders on a network share that matches the above folders. For example: \\server\share\Icons, \\server\share\settings, etc. and I use Group Policy to copy ("update") the contents of the folders from the network share to local machine. In the Icons folder, I use *.ico as the source in the GPP so as to only copy the icon files. Likewise, I use *.url in the Shortcuts folder, *.xml in the StartLayouts folder, and *.exe in the Launchers folder.
CREATING .EXE FILES, .LNK FILES AND .ICO FILES:
This is the most tedious part but it's also the most important for reliability. It makes sure that there's .lnk files available for the start layout that point to a corresponding .exe file that's always present whether that software is installed or not. This will ensure that the icon always works. It also gives you a lot of flexibility like launching a website with a particular browser as I describe below. If you want to spend some time with AutoHotKey, you can do all kinds of things with it. For example, I am slowly transitioning from Office 2013 to Office 2016 in my environment but I want a consistent shortcut on the desktop and start menu so I use if/then in the .exe that I created with AutoHotKey for each program (Word, Outlook, etc.) that checks to see if 2016 is available and then launches 2013 if not.
Firefox is in the example but you can create as many as you want. In the Launchers folder on a test machine, I create an AutoHotkey script (.ahk file) that simply has the following two commands:
- #NoTrayIcon
- run,"C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
Before I move on, many of our applications are cloud based and some of them work better in different browsers. As I mentioned in my list of problems above, the Start Layout feature doesn't like .url files. You can add the website at the end of the run command to have it launch that website in that browser. For example:
- run,"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" Google
- run,"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" /new-window Google
The first example will launch www.google.com in Firefox and the second one will launch www.google.com in a new Chrome window.
Once you've created your AutoHotKey script and saved it, you have two options. The easy way is simply to right-click on the .ahk file and select "Compile Script". This will create an .exe file that will launch your program. However, this will use the default AutoHotKey icon embedded in the .exe. Instead, I like to use a custom .ico file that I can control so that it's never missing in the Start layout. To extract an .ico file from an .exe, I've used BeCyIconGrabber (BeCyIconGrabber) but I prefer to spend a few minutes to find a higher resolution picture to use as my icon. Once I've downloaded and cropped a picture, I like to use www.icoconverter.com to create the .ico file because it includes multiple resolutions in the same .ico file. I then put this in the C:\BFRD\Icons folder. Once I have the .ico file, I use "Convert .ahk to .exe" (installed with AutoHotKey) because you can embed the custom icon file into the .exe. I save this .exe in the Launchers folder.
TIP: Once I've found the picture that I want to use, I use the Transparency Wizard at Online Image Editor to create a transparent background. Definitely not required for any of this to work but it's a nice touch, especially if you're also going to put it on the desktop.
Now I create a shortcut (.url file) to the new .exe file in the C:\BFRD\Shortcuts folder. This should always use the custom icon that's now embedded in the .exe (if you took that step) but, just to make sure, I also right-click on the shortcut, select "Change icon" and point it to the .ico file that I put in C:\BFRD\Icons. This is probably overkill but it's a quick thing to do and I'm not 100% sure where the Start Layout is grabbing its icon.
After I've done all of the above steps, I copy the new files in the Icons, Shortcuts and Launchers folders into their corresponding folders on the network share. As mentioned in the previous section, I only copy .exe files from the network share to the local machine in the Launchers folder but I store the .ahk files in that folder in the network share. This makes it very easy to make and deploy changes to it in the future.
Now the files are in a central location and they get deployed to the local machine because of the Group Policy Object that I mentioned in the previous section. As I mentioned in the list of problems, the Start Layout feature is only reliable if your shortcuts (.url files) are in the C:\ProgramData\Microsoft\Windows\Start Menu\Programs folder. For that reason, I use Group Policy Preferences to create a folder at "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\BFRD Links" and copy ("update") all of the .lnk files from \\server\share\Shortcuts into it. Optionally, you can also copy those shortcuts to C:\Users\Public\Desktop if you want all of the same shortcuts on the desktop.
CREATING AND EXPORTING THE START LAYOUT AND SETTING IT TO APPLY WITH GROUP POLICY:
Now you're going to create a start layout on a template computer, export it, copy it to a network share and then apply it. Make sure that your template computer is included in the OU where you've assigned the Group Policy Object that you used for all of the settings above and either reboot or run gpupdate /force on that machine to make sure that all of the files are copying correctly. On your template machine, remove all of the default buttons in the start menu that you don't want to deploy and go to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\(optional folder\). Right-click on all of the shortcuts that were copied there by Group Policy and select "Pin to Start". Re-arrange everything to your liking and then use the powershell command "Export-StartLayout" to create the .xml file as detailed at Customize and export Start layout (Windows 10).
Now you have to fix the layout of the .xml file that was broken in 1803. The fix/workaround was posted by Srbishb at Windows 10 loses XML based menu after 1803 upgrade. You simply have to modify the top few lines of the .xml file as Srbishb describes. Put the resulting .xml file in the \\server\share\Settings\StartLayouts folder.
You have two options for the .xml file. As mentioned above, I prefer to copy all of my files to the local machine with Group Policy. I copy it to C:\BFRD\Settings\StartLayouts from the network share and apply it from there but you can apply it directly from the network share if preferred. In either case, in Group Policy, go to (either Computer or User Configuration)\Policies\Administrative Templates\Start Menu and Taskbar\Start Layout and point to the .xml file.
You can and should run gpupdate /force on another machine or on a different user profile on your test machine to make sure that it's working.
MAKING CHANGES IN THE FUTURE:
One of the many glitches in this feature is that if you modify the .xml file without re-naming it, it usually won't apply to an existing user profile. In order to get that to work, you need to copy the .xml file before you make your changes with a new name and then update the reference to it in Group Policy. I just add a date at the end of the filename but you can number it or do something else. Just don't re-use the same filename.
You can modify the AutoHotKey files directly on the network share as long as you're not making any changes to the icon and you don't change the name of the file. Use "Convert .ahk to .exe" after you modify and save the .ahk file and apply the same .ico file that you did when you created the original. On the client machine, once GP copies the .exe, this will only update the .exe file that is the target of the .lnk in the Start Menu. Just make sure that you run through all of these steps above to create a new link, change the name of an existing link, or update the icon of an existing link.
I'd like to include a picture of mine but my account hasn't been verified yet so I can't post links or pics. I'll add it later if possible.
More...