I found the solution by mounting the hive in HKLM instead of HKU! And now I have my settings displayed and applied to each new Windows profile.
Source : https://blog.redit.name/posts/2015/powershell-loading-registry-hive-from-file.html
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I'm having a problem customizing the default profile NTUSER.DAT
I use the following script to modify the default profile so that all new profiles can have the same settings.
#===========
# VARIABLE
#===========
$path = "Software\Microsoft\Windows\CurrentVersion\Internet Settings"
$path2 = "Control Panel\Desktop\WindowMetrics"
$path3 = "Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects"
$path4 = "Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
$path5 = "Control Panel\Desktop"
$Input="91,1e,07,80,10,00,00,00"
$hexified = $Input.Split(',') | % { "0x$_"}
#===============
# HKU - DEFAULT
#===============
# Load Default User Profile
REG LOAD "HKU\Default" $env:SystemDrive\Users\Default\NTUSER.DAT
# Changes to Default User Registry
# Disabled - Automatically Detect Settings
New-ItemProperty "HKU\Default\$path" -Name "AutoDetect" -Value "0" -PropertyType DWORD -Force -Verbose
# Disabled - Visual Effects
New-ItemProperty "HKU\Default\$path2" -Name "MinAnimate" -Value "0" -PropertyType STRING -Force -Verbose
# Set Custom Performance Options
New-ItemProperty "HKU\Default\$path3" -Name "VisualFXSetting" -Value "3" -PropertyType DWORD -Force -Verbose
# Disabled - Animations in the taskbar
New-ItemProperty "HKU\Default\$path4" -Name "TaskbarAnimations" -Value "0" -PropertyType DWORD -Force -Verbose
# Set Custom
New-ItemProperty -Path "HKU:\$sid\$path5" -Name "UserPreferencesMask" -PropertyType BINARY -Value ([byte[]]$hexified) -Force -Verbose
# Unload NTuser.dat
REG UNLOAD "HKU\Default"
My problem is that when I open a new session I don't see any settings in the HKCU, but if I load the NTUSER.DAT hive I find the values I set with the previous script.
I don't understand why the values don't want to be displayed on the new profile. Maybe I've done something wrong?
Thanks for your help
I found the solution by mounting the hive in HKLM instead of HKU! And now I have my settings displayed and applied to each new Windows profile.
Source : https://blog.redit.name/posts/2015/powershell-loading-registry-hive-from-file.html