Whenever I'm installing Windows on new devices there are a lot of changes to be made which cost a lot of time. So I wanted to make some scripts which do exactly that for me.
For the past few days I have been searching for registry keys I can create/change for basic settings for Windows 10 (changing desktop wallpaper, small tray icons, etc). I found some and also have created my own, which I then have added together into a batch script.
I don't have much experience with batch scripts, but I wrote one, which when its executed as administrator will 'take' the keys in the folder the script is in, write them to the paths, then stop explorer.exe to and start it again for the changes to be applied.
@echo off reg import %~dp0TaskViewButton.reg reg import %~dp0SearchboxTaskbar.reg reg import %~dp0RemoveContacsFromTaskbar.reg reg import %~dp0EnableAutoTray.reg reg import %~dp0Wallpaper.reg reg import %~dp0TaskbandFavorites.reg reg import %~dp0TaskbandFavoritesChanges.reg reg import %~dp0TaskbandFavoritesResolve.reg taskkill /f /im explorer.exe start explorer.exe pause
When I executed the script every key was successful excluding DesktopWallpaper.reg. FOr DesktopWallpaper.reg I created a new key folder named System with this string value named Wallpaper in HKCU\Software\Microsoft\Windows\CurrentVersion\Policies as it was the only possibility that worked for me.
It worked until I exported and put it into that script. The only thing I added and changed to that .reg file was the name and a RGB value which should be the color of the wallpaper. This is what the file looks like:
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System] "Wallpaper"="46 141 239"
The command prompt shows an error for that file. When I double click the .reg file it tells me that an error occured while trying to access the registry as sysadmin. And not only that, executing the script also changes the wallpaper to a solid black. When accessing Personalisation > Background in the settings it tells me *Some settings are hidden or managed by your organization.
I have done some research on this as well and have tried fixing it with gpedit.msc. Apparently when Windows changes some settings they should also be in the Group Policy Editor. I followed some tutorials, but none of them worked for me. Some rules which should be enabled there were 'not configured'.
Any kind of help would be appreciated.