Change default profile NTUSER.DAT

Jeremy MONTOYA 0 Reputation points
2024-10-30T07:54:31.4866667+00:00

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

Windows for business Windows Client for IT Pros User experience Other
{count} votes

1 answer

Sort by: Most helpful
  1. Jeremy MONTOYA 0 Reputation points
    2024-10-31T09:14:47.3666667+00:00

    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

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.