How to automatically configure your default profile in Windows 10

Ever since Windows 10 was released, COPYPROFILE has been a major issue for administrators. It causes your default profile to be extremely large and it constantly causes issues with the Start Menu and other items in the Windows 10 OS. While developing a Windows 10 image, I found that injecting OS settings into C:\Users\Default\NTUser.dat has been the best way to configure the default profile. A year after upgrading over 2000 computers to Windows 10, I can now confidently say this method works 100% of the time and I really hope others start to use it more often.

Luckily for you, I have done the dirty work and can provide you with a starting point that can automatically configure settings for you. Keep in mind that you will need to run this script before running SYSPREP and it will change the settings for any new users. Good luck and please feel free to leave any questions in the comments below.

reg load HKLM\DEFAULT c:\users\default\ntuser.dat

# Advertising ID
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v Enabled /t REG_DWORD /d 0 /f

#Delivery optimization, disabled
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization" /v SystemSettingsDownloadMode /t REG_DWORD /d 3 /f

# Show titles in the taskbar
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v TaskbarGlomLevel /t REG_DWORD /d 1 /f

# Hide system tray icons
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer" /v EnableAutoTray /t REG_DWORD /d 1 /f

# Show known file extensions
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t REG_DWORD /d 0 /f

# Show hidden files
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Hidden /t REG_DWORD /d 1 /f

# Change default explorer view to my computer
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v LaunchTo /t REG_DWORD /d 1 /f

# Disable most used apps from appearing in the start menu
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_TrackProgs /t REG_DWORD /d 0 /f

# Remove search bar and only show icon
reg add "HKLM\DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v SearchboxTaskbarMode /t REG_DWORD /d 1 /f

# Show Taskbar on one screen
reg add "HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v MMTaskbarEnabled /t REG_DWORD /d 0 /f

# Disable Security and Maintenance Notifications
reg add "HKLM\DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.SecurityAndMaintenance" /v Enabled /t REG_DWORD /d 0 /f

# Hide Windows Ink Workspace Button
reg add "HKLM\DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\PenWorkspace" /v PenWorkspaceButtonDesiredVisibility /t REG_DWORD /d 0 /f

# Disable Game DVR
reg add "HKLM\DEFAULT\System\GameConfigStore" /v GameDVR_Enabled /t REG_DWORD /d 0 /f
reg add "HKLM\DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR" /v AppCaptureEnabled /t REG_DWORD /d 0 /f

# Show ribbon in File Explorer
reg add "HKLM\DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Ribbon" /v MinimizedStateTabletModeOff /t REG_DWORD /d 0 /f

# Hide Taskview button on Taskbar
reg add "HKLM\DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowTaskViewButton /t REG_DWORD /d 0 /f

# Hide People button from Taskbar
reg add "HKLM\DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" /v PeopleBand /t REG_DWORD /d 0 /f

# Hide Edge button in IE
reg add "HKLM\DEFAULT\SOFTWARE\Microsoft\Internet Explorer\Main" /v HideNewEdgeButton /t REG_DWORD /d 1 /f

# Remove OneDrive Setup from the RUN key
reg delete "HKLM\DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /F

reg unload HKLM\DEFAULT

If you would like to customize the Start Menu Tiles, please refer to my earlier post:
https://www.joseespitia.com/2016/06/27/customized-a-windows-10-start-layout/

88 Comments

  1. Hello Jose
    does this procedure clone the same start menu tiles position for all users?

  2. Hello Jose and thank you for sharing your knowledge.

    How do you apply this?
    Is it a script you launch or use with cmd or powershell?
    It reminds me a way to change the default wallpaper under windows 7 but I was loading the .default user registry by charging the default user registry with this powershell command :
    REG LOAD HKU\PROFIL_DEFAULT C:\Users\Default\ntuser.dat

    But you use this one:
    reg load HKLM\DEFAULT c:\users\default\ntuser.dat

    I don’t know which one is the better nor the differences or if the result is the same.
    What’s your opinion?

    Thank you for your work.

    Sylvain

    • Jose Espitia

      Hi Sylvain,

      I run this script automatically with my MDT capture task sequence but you can technically run this script anyway to configure the default profile.

      As for your other question, it doesn’t really matter where you load C:\Users\Default\ntuser.dat. If you manually run reg load HKLM\DEFAULT c:\users\default\ntuser.dat, you will see HKLM\DEFAULT when you open regedit. Inside of HKLM\DEFAULT is the default profile’s HKCU.
      Example:
      HKLM\DEFAULT\SOFTWARE is actually the default profile’s HKCU\SOFTWARE.

      I hope this helps clear up a few things and let me know if you have any other questions.

  3. Hi Jose,

    Thanks for sharing your wisdom. I’m pretty new at this but I’ve been using copy profile and made my customization in the Audit mode and it worked well till version 1709 came along. In the past version, I would remove all the provisioned apps, setup desktop, start up menu sysprep. My question is, do I still follow the same procedure, in audit mode, customize it, set the start up menu, run script and sysprep? Little confused on the procedure. Any guidence for the “new” guy will be much appreciate it! 🙂

    • Jose Espitia

      I would suggest dropping COPYPROFILE and running the script that I posted to configure your default profile.

  4. Thank you for sharing.
    Please could you be more specific.
    When do you inject these enties?

    Before Sysprep?
    In audit Mode?
    or
    During deployment as part of the unattend.xml
    or
    after deployment, as a onetime script?

    • Jose Espitia

      You can run the batch script before running Sysprep to configure the default profile.

    • Jose Espitia

      Tim,
      You will want to run this before SYSPREP and you cannot use COPYPROFILE because it will overwrite your configuration.

  5. Jose,

    I am in the process of building out an MDT server, I would like to customize the start menu/tiles/taskbar to create a basic vanilla image. Can I go ahead and run through your process to make the customization then run sysprep the grab an image of the final product? Would this work in terms of general settings sticking while loading the .iso of this image to MDT? Or would it be easier to use MDT to do any customization using an an .iso of windows 10 build 1709? Any help here would be greatly, appreciated, thanks!

    • Jose Espitia

      You can definitely run through my process to customize your default profile. I normally import the start layout and run this batch script before my MDT capture task sequence runs sysprep.

  6. I saved it as .bat file and ran as an administrator but did not change anything on Win 10 Ent 1709. You mentioned that you are using MDT which is not the case for everyone. How we will edit this file and use it correctly. If you can elaborate and put into steps that would be very helpful for many of us. Your method very exciting and I can’t wait to make it work. Thanks

    • Jose Espitia

      Hi Attila,

      You will need to run the script before running SYSPREP or run it after you have completed reimaging a computer. The script will modify the Default profile so it will only affect new accounts.

  7. Hi Jose,

    Thanks for the effort.

    Can I run this PowerShell in audit mode before I run the Sysprep process?

    • Jose Espitia

      Yes you can run the script before Audit Mode but do not use COPYPROFILE because it will overwrite any changes that you made with the script.

  8. Thanks for you guide man! We deploy to Surface Pro tablets every year for students and have been using the Copyprofile feature. Kind of a bummer that it is breaking things. Can you elaborate on how I can set desktop shortcuts on new users like, Word 2016, Custom URLS with custom icons, applications installed like Artweaver? CopyProfile used to do this for us by literally just copying the administrators desktop shortcuts to the default users.

    • Jose Espitia

      Hi Justin,

      I’m glad that you enjoyed the guide! To setup desktop icons, all you have to do is copy the shortcuts to C:\Users\Default\Desktop.

      • Wow! How have i never thought of that? One more thing while i got you, What about setting the desktop background? I know you can do this though GPO, but we like to have it load our custom background when the student logins for the first time, whether on campus or not.
        Thanks again!

        • Jose Espitia

          I use Jörgen Nilsson’s method which can be found here:
          http://ccmexec.com/2015/08/replacing-default-wallpaper-in-windows-10-using-scriptmdtsccm/

          Essentially, you will be replacing the wallpapers in “C:\windows\web\4k\Wallpaper\Windows” and “C:\windows\web\Wallpaper\Windows” with your own custom wallpaper. I already have a script that can automate this but you will need to tweak it if you are not using MDT.(I’ll be more than happy to help you set it up if you need any assistance)
          The script can be found in my latest post “How to capture a Windows 10 image like a boss with MDT!” which can be found here:
          https://www.joseespitia.com/2018/02/08/how-to-capture-a-windows-10-image-like-a-boss-with-mdt/

          • Thanks! One more question and I promise this will be the last. I am a little old fashioned and I basically run a windows iso in HyperV, install all my software, then sysprep from within the the running VM. I then basically just create a capture only type Task Sequence. After I have my image captured, I have another Task Sequence that I use for deployment. I know this is super weird, but it’s the way I was taught to do it. Anyway, can I use all of your custom tasks for the deployment process, such as default profile, windows background, taskbar changes, or do i need to run these in the capture sequence?

          • Jose Espitia

            I have had success with running these custom tasks before running SYSPREP in my Capture Task Sequence.

  9. Hi!

    Does the following settings work for you with 1709:

    -) LaunchTo
    -) Hidden
    -) HideFileExt

    On my test client these settings are ignored …

    • Jose Espitia

      March 20, 2018 at 5:29 pm

      If it doesn’t work, I would suggest setting the registry keys as a run once user preference in your GPO.

  10. Hi Jose, Thanks for the great script! I am newbie to MDT and i wasbjust wondering how this could be added to MDT. Will it be saved as a .bat file or a .reg file? Please kindly let me know.

    Thank you in advance.
    AlbFre

  11. Would it work if I moved the NTuser.dat file from my pre-configured administrator account to the default profile?

    Thanks.

    • Jose Espitia

      March 20, 2018 at 5:26 pm

      It should work since this is what COPYPROFILE does but I would recommend not doing it because it does copy over some unnecessary keys and it keeps references to the administrator account.

  12. Hi Jose,
    we have an image W10 and i use copy profile to keep my setting profile like: office 2k16, favoryte IE, Edge, Firefox, and some other software like VLC…

    we use mandatory profile but with Windows 10 we can’t modify mandatory profile like we do with Windows 7 because that corrupt our profile… your script look good but any idea to keep our software setting and apply to default profile easily?

    thanks

    Sylvain

  13. Hey Good stuff Jose,

    This is our first year using WIN10 getting ready to make an image with WDS. Do you have any info of creating a good basic image with default profile? Thanks

    Mike

  14. I am trying to inject some registry edits to the default ntuser.dat as described. The command I usually run is:
    reg add “HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People” /V PeopleBand /T REG_DWORD /D 0 /F
    However I can see that this only applies for the “current user” how can I inject this reg to the default user?

  15. I have a registry setting that I would like to add to the default user registry.
    I usually use this command to turn off “animate windows when minimizing and maximizing”
    reg add “HKCU\Control Panel\Desktop\WindowMetrics” /v “MinAnimate” /t REG_SZ /d “0” /f
    So I tried to edit it to:
    reg add “HKLM\DEFAULT\Control Panel\Desktop\WindowMetrics” /v “MinAnimate” /t REG_SZ /d “0” /f
    But it does not work for some reason. Am I doing something wrong here?

    • Jose Espitia

      April 18, 2018 at 6:17 pm

      You need to load and unload the default profile’s NTuser.dat. So it would look like this:
      reg load HKLM\DEFAULT c:\users\default\ntuser.dat
      reg add “HKLM\DEFAULT\Control Panel\Desktop\WindowMetrics” /v “MinAnimate” /t REG_SZ /d “0” /f
      reg unload HKLM\DEFAULT

      • Thanks for taking time to reply. I did load and unload it actually, just forgot to say. Still doesn’t work 🙁 I know the registry works on the current user though, which makes this strange… If I do the trick first, then check the default profile’s NTuser.dat I can confirm that the change has been applied to the default NTuser.dat. Then I make a new user account and check “WindowMetrics” in regedit to see if the change has been applied. Unfortunately it has not. So it seems something is keeping Windows from applying the change in NTuser.dat to the new profile.

        • Jose Espitia

          May 1, 2018 at 6:58 pm

          scribbleG, I have run into some settings that will do this. In order to get around this, I add the registry key as a user preference that applies once in my GPO. This way all new users will get the setting.

          • Oh snap! How do you do that? I have searched for this for hours without finding any useful info.

          • Jose Espitia

            June 26, 2018 at 1:42 pm

            ScribbleG,

          • Open Group Policy Management Console (gpmc.msc)
          • Create a new (or edit an existing) GPO and assign it to the appropriate Active Directory Organizational Unit. After that switch it to edit mode
          • Expand GPO Computer (or User) Configuration -> Preferences ->Windows Settings -> Registry in the context menu. Select New -> Registry Item
  • First of all, thanks for your sharing.

    After we modify HKCU(load/unload) and HKLM(only via reg add) value of WIN2K16 in audit mode,

    1. Sysprep with CopyProfile=True
    HKCU vlaue won’t work, and HKLM value is working fine.

    2. Sysprep with CopyProfile=False
    Both of HKCU and HKLM value are working fine as expected .

    Although the second result is what I want, I’m still wondering to know that “CopyProfile=True” is applied to Default Users, isn’t it ?

    Can we make neither HKCU nor HKLM which modify in audit mode will apply to Default User and are working fine after sysprep ?

  • Thanks for this as with 1803 I am finally at my wits end with copyprofile.

    But one thing, how would I get ride of that annoying Edge desktop icon that appears for every new user? I did see a reg edit that I thought would work but not totally sure how to go about adding it to your script above.

    This is what I found;

    reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer /v “DisableEdgeDesktopShortcutCreation” /t REG_DWORD /d “1” /f

    I think that is actually from a comment you made. Do I add that in just as is or what? Thanks in advance.

    • Jose Espitia

      June 11, 2018 at 3:19 pm

      ToDash, you can add it to your existing default profile clean up script or add reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer /v “DisableEdgeDesktopShortcutCreation” /t REG_DWORD /d “1” /f as a separate command line in your TS (If you are using MDT or SCCM).

      • Works great as long as you remove the quotes.

        reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer /v DisableEdgeDesktopShortcutCreation /t REG_DWORD /d 1 /f

        Putting that right before the mounting of the ntuser.dat in this script has worked for me. Thanks for the help, it is very much appreciated.

        • Jose Espitia

          June 12, 2018 at 5:40 pm

          Sorry ToDash! Sometimes copying and pasting the quotes do not actually copy over correctly. If you look at it closely the quotes when copied “” “” are different.

  • Hi – Thanks for this site! FWIW, there are reg settings for the desktop icons:
    # Add Desktop Icons – This PC
    reg add “HKLM\DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel” /v {20D04FE0-3AEA-1069-A2D8-08002B30309D} /t REG_DWORD /d 0 /f
    # Control Panel
    reg add “HKLM\DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel” /v {5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0} /t REG_DWORD /d 0 /f
    # Recycle Bin
    reg add “HKLM\DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel” /v {645FF040-5081-101B-9F08-00AA002F954E} /t REG_DWORD /d 0 /f
    # Network
    reg add “HKLM\DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel” /v {F02C1A0D-BE21-4350-88B0-7367FC96EF3C} /t REG_DWORD /d 0 /f

    It’s a bit better than shortcuts because when you right-click the desktop icons, like ‘This PC’, for example, you can go to the PC Properties rather than the shortcut properties.

  • Hi Jose,

    Using MDT, but I only deploy the vanilla Win 10 wim (v1803). I do not sysprep or capture – hence I would not be able to take advantage of this, correct?

    If so, you mentioned to another user about setting a registry key as a user preference in GP :

    “….I add the registry key as a user preference that applies once in my GPO. This way all new users will get the setting.”

    Can I apply all the above as a user preference in Group Policy Management Editor?
    – User Configuration > Preferences > Windows Settings > Registry ?

    Lastly, is there a reason to do this as part of sysprep and capture VERSUS using GPOs?

    • Jose Espitia

      June 26, 2018 at 1:50 pm

      Patrick, you can still use this method to make customizations to your default profile. Also the only advantage of applying the settings directly to your default profile is that you will have the settings already baked into the OS and you will not be dependent on GPO to apply the settings.

  • Hi Jose,

    Previous post did not show up, so hoping this will.

    Can all of this be achieved using group policy?
    (Group Policy Management Editor > User Configuration > Preferences > Windows Settings > Registry)

    You stated : “…I add the registry key as a user preference that applies once in my GPO. This way all new users will get the setting….”

    Is there an advantage of doing this outside of group policy?

    • Jose Espitia

      June 26, 2018 at 1:48 pm

      Yes, I was referring to using GPO to deploy registry keys (Group Policy Management Editor > User Configuration > Preferences > Windows Settings > Registry). I mainly do this for MS Office settings that I can’t add via C:\Users\NTUser.dat.

  • Thanks again for the great site. One thing I noticed is that the Delivery optimization doesn’t seem to stick, at least in my builds. Nothing huge (GPO generally takes care of it) but still not sure why it isn’t. This is of course on 1803.

    Also do you know of any ways to set the “Show suggestions occasionally in Start” – Under Start menu settings to off. Since it is not activated during audit mode I would suspect maybe a reg entry?

    I was also trying to find a way to include file explorer in the folders that appear in start (the little links on the left side). I even did a reg compare between having it off and on and couldn’t find anything that seemed to relate. Any thoughts?

    Oh and one more thing (was about to say last but you never know), the general lock screen settings, like making sure windows spotlight is on and more importantly having no apps show quick status on the lock screen.

    Thanks for any help and insight

    • Jose Espitia

      June 26, 2018 at 7:39 pm

      Ian,
      – 1. There are some settings that get overwritten at logon. For those settings, I would suggest using GPO to deploy the registry key.
      – 2. Try adding this to the script in my blog:
      reg add “HKLM\DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager” /v SystemPaneSuggestionsEnabled /t REG_DWORD /d 0 /f
      – 3. This setting is stored in a binary registry key that most likely controls multiple settings. (HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount\$$windows.data.unifiedtile.startglobalproperties\Current\Data)
      – 4. I believe Spotlight is turned on by default so you shouldn’t need to do anything. As for disabling app notifications in the lockscreen, add the following command to the script that I posted:
      reg add “HKLM\DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings” /v NOC_GLOBAL_SETTING_ALLOW_TOASTS_ABOVE_LOCK /t REG_DWORD /d 0 /f

      • Awesome thanks for the tips. I will give them a try tomorrow. Time to leave the office for the day.

      • Brilliant Jose! Thank you so much for posting this! I have been pulling my hair out trying to get copyprofile to work. Your script works great, I cannot thank you enough. Now I can go on vacation and not think about work the whole time!

  • Hello Jose, would you happen to know the syntax to also remove the store and mail client icons from the task menu?

    Thanks!

  • trying this on 1809 and now store and mail are on the taskbar. Anyone know of the registry entry’s to remove store and mail from the taskbar? Thanks

  • Hi,

    Great guide. Is there way to edit printer settings such as default printer and/or default printing settings via this method?

    I was thinking of setting kiosk account, and was wondering if one could change that user print settings with this method?

  • Thanks Jose, this saved me a lot of time.

  • Hi Jose once again.

    I’m finally trying to get a grasp on using MDT properly to create my images (and get something for the mass amount of 7 to 10 upgrades we have to do) and I am wondering about this batch. I have been looking at your guide to using MDT and was wondering where would I stick this in there? Should I just do this up as a batch then create a custom task for it? Or would I add it in to the machine config powershell script you have on that MDT guide? This is all for 1809.

    Thanks in advance for your help.

    • Ummm, I’m either an idiot or been staring at way too many things and not getting enough coffee. I somehow completely missed that it is in your instructions clear as day. Man I think it is time to stop for the day.

      Sorry, my bad.

      • Jose Espitia

        March 8, 2019 at 7:47 pm

        It happens to the best of us ToDash 🙂 Let me know if you have any other questions!

  • So… is there a reason I cant copyprofile during sysprep (to capture what it will as itgets “some” stuff) and then run this after the end of the PreApplication Update reboot as a PS script, then forcing a reboot before it installs the app stack in MDT? … This way when Microsoft changes reg locations in some upcoming feature or cumulative update, you only have to edit the script and not have to run it and then sysprep another custom image?

    Just trying to think ahead to how Microsoft can screw me on this down the road…lol

    • Jose Espitia

      March 8, 2019 at 6:29 pm

      Andy,
      If you are going to use COPYPROFILE, you might as well just use the HKCU hive and bypass having to load the default profile’s ntuser.dat. With COPYPROFILE enabled, it will overwrite any changes you made to the default profile since it really just copies your administrator profile into C:\Users\Default.

  • Mr. Espitia, I need some help. How can I let my Desktop Icons stick for every user? I configure everything but it only works for the current user. Thanks

    • Jose Espitia

      April 17, 2019 at 2:50 pm

      Proffelio, you can add shortcuts to C:\Users\Default\Desktop or C:\Users\Public\Desktop.

  • Now with 1903 out, have you had a chance to see if there is any way to force Dark Mode as the default? Specifically dark mode for explorer, which I believe is called default app mode under colors. I thought I had found a way with a reg but it did not stick.

    Any thoughts? And once again thanks for the site, it has helped greatly with both my nice blow it all away image and with our in-place upgrades.

  • 861/5000
    Hello Jose. First, thank you a lot for taking the time to share your tips and answer questions.
    While I was looking for registry keys to modify to set Windows for my new image, I discovered your pretty interesting script.
    I usually put my new registry keys in the HKU\ loading hive, and in the HKLM\software\… without loading the hive, and it works. I understand that in the HKU it is necessary to load the hive because if not, we cant change the default session settings for new users. However, I notice that in your script, you also load the hive into the HKLM. Why would you do that? What does it guive to put the configs in the hive of the HKLM, considering that the settings of this section already apply to the whole computer and therefore to all the users?
    Thanks

    • Jose Espitia

      July 24, 2019 at 7:35 pm

      Vince,
      The reason why I’m modifying the HKLM hive in this script is because I’m loading the default profile into HKLM\Default temporarily. Once you unload the default profile that key will no longer exist and it will actually update C:\Users\Default\NTUser.dat

  • Hi Jose, this is a great article thanks for posting! Do you know if there is a way to enable specific System Tray Icons for the default profile instead of turning them all On or Off?

    • Jose Espitia

      July 24, 2019 at 6:45 pm

      Hi Eric,
      Unfortunately these settings are stored in a binary key which I do not recommend manipulating since binary keys usually store configurations for multiple settings.

  • Hi Jose,
    GREAT content on your site – thanks for your hard work! I’m interested in knowing how to add keys from other hives (HKCR) into the default profile, or is this not possible (or necessary) using this process? Basically I’d like to add the “Real” IE icon to all user’s desktop (not just a shortcut to IE). Previously I would use the following Regedit:

    [-HKEY_CLASSES_ROOT\CLSID\{871C5380-42A0-1069-A2EA-08002B30301D}]

    [HKEY_CLASSES_ROOT\CLSID\{871C5380-42A0-1069-A2EA-08002B30301D}]
    @=”Internet Explorer”
    “InfoTip”=”@C:\\Windows\\System32\\ieframe.dll,-881″

    [HKEY_CLASSES_ROOT\CLSID\{871C5380-42A0-1069-A2EA-08002B30301D}\DefaultIcon]
    @=”C:\\Windows\\System32\\ieframe.dll,-190″

    [HKEY_CLASSES_ROOT\CLSID\{871C5380-42A0-1069-A2EA-08002B30301D}\InProcServer32]
    @=”C:\\Windows\\System32\\ieframe.dll”
    “ThreadingModel”=”Apartment”

    [HKEY_CLASSES_ROOT\CLSID\{871C5380-42A0-1069-A2EA-08002B30301D}\shell]
    @=”OpenHomePage”

    [HKEY_CLASSES_ROOT\CLSID\{871C5380-42A0-1069-A2EA-08002B30301D}\shell\NoAddOns]
    @=”Start Without Add-ons”

    [HKEY_CLASSES_ROOT\CLSID\{871C5380-42A0-1069-A2EA-08002B30301D}\shell\NoAddOns\Command]
    @=”\”C:\\Program Files\\Internet Explorer\\iexplore.exe\” -extoff”

    [HKEY_CLASSES_ROOT\CLSID\{871C5380-42A0-1069-A2EA-08002B30301D}\shell\OpenHomePage]
    @=”Open &Home Page”

    [HKEY_CLASSES_ROOT\CLSID\{871C5380-42A0-1069-A2EA-08002B30301D}\shell\OpenHomePage\Command]
    @=”\”C:\\Program Files\\Internet Explorer\\iexplore.exe\””

    [HKEY_CLASSES_ROOT\CLSID\{871C5380-42A0-1069-A2EA-08002B30301D}\shell\Properties]
    @=”P&roperties”
    “Position”=”bottom”

    [HKEY_CLASSES_ROOT\CLSID\{871C5380-42A0-1069-A2EA-08002B30301D}\shell\Properties\command]
    @=”control.exe inetcpl.cpl”

    [HKEY_CLASSES_ROOT\CLSID\{871C5380-42A0-1069-A2EA-08002B30301D}\Shellex\ContextMenuHandlers\ieframe]
    @=”{871C5380-42A0-1069-A2EA-08002B30309D}”

    [HKEY_CLASSES_ROOT\CLSID\{871C5380-42A0-1069-A2EA-08002B30301D}\Shellex\MayChangeDefaultMenu]
    @=””

    [HKEY_CLASSES_ROOT\CLSID\{871C5380-42A0-1069-A2EA-08002B30301D}\ShellFolder]
    @=”C:\\Windows\\System32\\ieframe.dll,-190″
    “HideAsDeletePerUser”=””
    “Attributes”=dword:00000024
    “HideFolderVerbs”=””
    “WantsParseDisplayName”=””
    “HideOnDesktopPerUser”=””

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{871C5380-42A0-1069-A2EA-08002B30

  • Great fix! Thanks for sharing

  • That’s amazing. It’s information sharing like this and people like you who share this that contribute to making systems better for everyone!

  • Can this be done with PowerShell? I found out that our current MDT system is actually using your original script as-is.
    We have another script that adjusts various registry values in HLKM, ex:

    #Disable Consumer Features
    New-Item -Path “HKLM:\SOFTWARE\Policies\Microsoft\Windows” -Name “CloudContent”
    Set-ItemProperty -Path “HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent” -Name “DisableWindowsConsumerFeatures” -Type DWord -Value 1

    Can your original script be done in PowerShell so I can combine these into one big script file? I tried to convert your code:

    Original:
    # Advertising ID
    reg add “HKLM\DEFAULT\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo” /v Enabled /t REG_DWORD /d 0 /f

    PowerShell Version:
    # Advertising ID
    $key = “Registry::HKEY_LOCAL_MACHINE\DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo”
    New-Item -Path $key -Force | Out-Null
    New-ItemProperty -Path $key -Name Enabled -PropertyType DWORD -Value 0 -Force | Out-Null

    but it doesn’t appear to be working, as this value does not exist when I check the DEFAULT hive for this value in my VM created through MDT.

    Knowing that the script has do load the default use hive (I hope I’m using that terminology correctly), I found this script located at:

    https://www.checkyourlogs.net/powershell-updating-the-default-and-all-user-profiles-registry/

    It seems like it loading the ntuser.dat file like your script is, but it’s also trying to do it to all profiles that may already be on the machine.

    • Jose Espitia

      June 23, 2020 at 5:48 pm

      Hi Adam, I have used the following function to load the NTUser.dat:
      Function Get-NTUSERDAT {
      [cmdletbinding()]
      Param(
      [Parameter(
      Mandatory=$false,
      Position=0,
      ValueFromPipeline=$true,
      ValueFromPipelineByPropertyName=$true)]
      [array]$User = $Env:USERNAME,
      [switch]$All,
      [switch]$Dismount
      )
      If ($All) {
      $User = $(Get-ChildItem "$($env:systemdrive)\Users\").Name
      }
      If (-not $Dismount) {
      Foreach ($name in $User) {
      Try {
      $newname = $($name.replace(".",""))
      $hive = "HKLM\DEFAULT"
      $path = "$($env:systemdrive)\Users\$name\ntuser.dat"
      reg load $hive $path
      New-PSDrive -Name $newname -PSProvider Registry -Root $hive -Scope Global
      } Catch {
      }
      }
      } Else {
      Foreach ($name in $User) {
      Try {
      $newname = $($name.replace(".",""))
      Remove-PSDrive -Name $newname
      reg unload "HKLM\DEFAULT"

      [GC]::Collect()
      } Catch {
      }
      }
      }
      }

      Example:
      Get-NTUSERDAT -User Default
      # Advertising ID
      $key = “Registry::HKEY_LOCAL_MACHINE\DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo”
      New-Item -Path $key -Force | Out-Null
      New-ItemProperty -Path $key -Name Enabled -PropertyType DWORD -Value 0 -Force | Out-Null
      Get-NTUSERDAT -User Default -Dismount

  • Does this remove all existing HKLM settings? I tried to run this on a server and it deleted a registry file that was already loaded into HKLM prior.

    • Jose Espitia

      Craig, as you can see in the script, the only thing the script deletes is the following key:
      HKLM\DEFAULT\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
      Keep in mind HKLM\DEFAULT is only mounted temporarily to load C:\Users\Default\ntuser.dat.

  • Hi Jose,

    In regards to your script customizing the default profile, what entries are required for default wallpaper and theme. So, that each new user profile will get the same desktop background at logon. I am planning on implementing the script to run after the OS has been deployed and configured using a Windows 10 20H2 OS deployment SCCM task sequence .
    Thanks
    Jeff

    • Jose Espitia

      Hi Jeffrey, I personally update “C:\windows\web\wallpaper\windows\img0.jpg” with my custom wallpaper. I have been doing this since 1511 and so far I have not had any issues. The only thing to keep in mind is that you will need to update the wallpaper after every feature upgrade. It’s not a big deal because once you have it scripted, you can continue to reuse that script.

  • Dear Jose, thanks for all the hard work.

    Two questions:
    is there any way you can set the default apps for the default profile?
    is there any way to disable the store for the default profile?

    Thanks a lot!!!!

    • Jose Espitia

      June 7, 2021 at 6:44 pm

      You can set default apps with DISM or GPO. You can also disable the store via GPO as well 😀

  • Leave a Reply