Whenever I install Windows on new devices, there are many changes to make that take a lot of time. So I wanted to do scripts that do exactly that for me.
In recent days, I was looking for registry keys that I could create / modify for the basic settings of Windows 10 (changing the desktop wallpaper, small icons in the taskbar, etc.). I found it and I also created mine, which I then added in a batch script.
I do not have much experience with batch scripts, but I wrote one that, when it is run as an administrator, "takes" the keys of the folder in which the script is located, writes them to the access paths, and then stop explorer.exe and start again for the changes to take effect.
@ 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 ran the script, each key was successful, except for DesktopWallpaper.reg. FOr DesktopWallpaper.reg I have created a new key folder named System with this string value named Wallpaper in HKCU Software Microsoft Windows CurrentVersion Policies like that was the only possibility that worked for me.
It worked until I exported it and put it in this script. The only thing I added and modified in this .reg file was the name and an RGB value that should be the color of the wallpaper. Here is what the file looks like:
Windows registry editor version 5.00 [HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem] "Wallpaper" = "46 141 239"
The command prompt indicates an error for this file. When I double-click on the .reg file, he tells me that an error occurred while trying to access the registry as a system administrator. And not only that, the execution of the script also changes the screen background to black. When you go to Customization> Background in Settings, it tells me * Some settings are hidden or managed by your organization.
I've also done research on this and I tried to fix it with gpedit.msc. Apparently, when Windows modifies some settings, they should also appear in the Group Policy Editor. I followed tutorials, but none of them worked for me. Some rules to be enabled were "unconfigured".
Any help would be appreciated.