zeusabj Posted March 6, 2010 Share Posted March 6, 2010 Hey guys,I really hope someone can help me here because I'm at a loss here. I've been tasked with creating a Windows 7 image for deployment at my company. When I built our Windows XP images a few years ago it was pretty easy to set system-wide defaults. All I would do was create a dummy account, log in to that acount, make my customizations (default company wallpaper, disable "highlight new programs", etc) and then just overwrite the "Default" profile folder with the profile folder of the dummy account. When I got ready to start deploying Windows 7 I did some research and discovered that method was no longer supported. After looking into the methods that were supported I found this page:http://windowsteamblog.com/blogs/springboard/archive/2009/10/30/configuring-default-user-settings-full-update-for-windows-7.aspxI looked at what I wanted to accomplish and decided to go with what that site refers to as "option C", or "Targeted changes to the Default User Registry hive and profile folders". I took the code snippet they provided on their site and tried to adapt it to my purposes, but it does not appear to be working. Here's a sample of my code that is *supposed* to set a default wallpaper for every new user that logs in::: Load the default user hive, set Wallpaper value, unload Default User Hive when doneREG LOAD "HKU\Default" "%USERPROFILE%\..\Default User\NTUSER.DAT"REG ADD "HKU\Default\Control Panel\Desktop" /v WallPaper /t REG_SZ /d "C:\Windows\Web\Wallpaper\CompanyName\CompanyImage" /fREG UNLOAD HKU\DefaultFor the life of me I can't figure out why this is not working. Can anyone tell me what I'm doing wrong here? Link to comment Share on other sites More sharing options...
maxXPsoft Posted March 6, 2010 Share Posted March 6, 2010 try changing HKU\Default to different like HKU\MyTestI see a default value in root of HKU Link to comment Share on other sites More sharing options...
MrJinje Posted March 6, 2010 Share Posted March 6, 2010 Here is an older thread on the subject, you should modify the hive from setupcomplete.cmd so that it gets pushed into the default profile before the first user profile is created. If you wait until the first login, the settings will not apply to that first profile, but only to profiles created after the changes are made. Link to comment Share on other sites More sharing options...
maxXPsoft Posted March 6, 2010 Share Posted March 6, 2010 He is trying to modify NTUSER.DAT which you must make sure you have the image mounted and modify the one within the install.wim. I just see that he needed to change the Load Hive name maybe cause it would conflict.MrJinjeYou can add all that stuff directly as he is trying to do. Link to comment Share on other sites More sharing options...
zeusabj Posted March 6, 2010 Author Share Posted March 6, 2010 try changing HKU\Default to different like HKU\MyTestI see a default value in root of HKUOkay I'll give that a try and report back. Link to comment Share on other sites More sharing options...
zeusabj Posted March 6, 2010 Author Share Posted March 6, 2010 Here is an older thread on the subject, you should modify the hive from setupcomplete.cmd so that it gets pushed into the default profile before the first user profile is created. If you wait until the first login, the settings will not apply to that first profile, but only to profiles created after the changes are made.I am running this from the administrator profile, rebooting the computer. Creating a new user account from scratch and then logging in as that user to test. Shouldn't that work? Link to comment Share on other sites More sharing options...
zeusabj Posted March 6, 2010 Author Share Posted March 6, 2010 He is trying to modify NTUSER.DAT which you must make sure you have the image mounted and modify the one within the install.wim. I just see that he needed to change the Load Hive name maybe cause it would conflict.MrJinjeYou can add all that stuff directly as he is trying to do. So hold the phone, this can't be done within windows? I have to create the image first, then mount it, then run these commands? I have been doing my deployment to a VM and logging in as Administrator, then running this *within* the Windows 7 install I intend to capture. Could that me my problem? Link to comment Share on other sites More sharing options...
MrJinje Posted March 6, 2010 Share Posted March 6, 2010 (edited) I am running this from the administrator profile, rebooting the computer. Creating a new user account from scratch and then logging in as that user to test. Shouldn't that work?Yep, that should work (but only on a per computer basis), I don't know about the path in your sample, look at the sample from post #6 in the thread I linked. No such thing a "Default User" anymore, you are editing the wrong path entirely. In windows 7 Default User is now "Default". Just change your path to C:\Users\Default\ntuser.dat, instead of %USERPROFILE%\..\ Maybe that is the whole problem. reg load "hku\zzz" "C:\Users\Default\NTUSER.DAT"REG LOAD "HKU\Default" "%USERPROFILE%\..\Default User\NTUSER.DAT" Edited March 6, 2010 by MrJinje Link to comment Share on other sites More sharing options...
zeusabj Posted March 6, 2010 Author Share Posted March 6, 2010 I am running this from the administrator profile, rebooting the computer. Creating a new user account from scratch and then logging in as that user to test. Shouldn't that work?Yep, that should work (but only on a per computer basis), I don't know about the path in your sample, look at the sample from post #6 in the thread I linked. No such thing a "Default User" anymore, you are editing the wrong path entirely. In windows 7 Default User is now "Default". Just change your path to C:\Users\Default\ntuser.dat, instead of %USERPROFILE%\..\ Maybe that is the whole problem. reg load "hku\zzz" "C:\Users\Default\NTUSER.DAT"REG LOAD "HKU\Default" "%USERPROFILE%\..\Default User\NTUSER.DAT"I was under the impression that using "Default User" would still work because there is a junction point in place for that (do a "cd C:\Users\Default User\" at a CMD prompt and you'll see what I mean. Plus the above site's code also said to use default user, so i just assumed it would work. Maybe the junction point is jacking it up. I'll try your suggestion. Link to comment Share on other sites More sharing options...
maxXPsoft Posted March 6, 2010 Share Posted March 6, 2010 (edited) yes, they trying to move away from the junction points so not best to use, wish they had deleted all the mess before releasing 7.I missed default user, C:\Users\Default\NTUSER.DAT is correctFor machine settings it's different \Windows\System32\config\SOFTWAREEDIT: and neither one of us knew what you was doing, I mean modifying the image which is a heck of a lot easier or trying the dog and pony show from MS where you have 2 PC's and capture image Edited March 6, 2010 by maxXPsoft Link to comment Share on other sites More sharing options...
zeusabj Posted March 7, 2010 Author Share Posted March 7, 2010 (edited) So I changed my code to this:REM Load the default profile hiveREG LOAD HKU\Hive C:\Users\Default\NTUSER.DATREM Configure the default user profileREG ADD "HKU\Hive\Control Panel\Desktop" /v WallPaper /t REG_SZ /d "C:\Windows\Web\Wallpaper\Nature\img6.jpg" /fREM Unload the default profile hiveREG UNLOAD HKU\HiveAll the commands run successfully. So I reboot, create a new account, login as the user, and still no custom wallpaper. I'm just at a total loss! What in the world am I doing wrong here? Has anyone ever actually gotten this default registry hive thing to work? Can someone maybe give me a code snippet that they have confirmed to work so I can at least know it does do something?Please tell me someone knows the answer here. Edited March 7, 2010 by zeusabj Link to comment Share on other sites More sharing options...
MrJinje Posted March 7, 2010 Share Posted March 7, 2010 (edited) Change it to REG ADD "HKU\Hive....... Which you would have known had you read the link I originally posted.REM Load the default profile hiveREG LOAD HKU\Hive C:\Users\Default\NTUSER.DATREM Configure the default user profileREG ADD "HKU\Hive\Control Panel\Desktop" /v WallPaper /t REG_SZ /d "C:\Windows\Web\Wallpaper\Nature\img6.jpg" /fREM Unload the default profile hiveREG UNLOAD HKU\Hive Edited March 7, 2010 by MrJinje Link to comment Share on other sites More sharing options...
zeusabj Posted March 7, 2010 Author Share Posted March 7, 2010 Change it to REG ADD "HKU\Hive....... Which you would have known had you read the link I originally posted.REM Load the default profile hiveREG LOAD HKU\Hive C:\Users\Default\NTUSER.DATREM Configure the default user profileREG ADD "HKU\Hive\Control Panel\Desktop" /v WallPaper /t REG_SZ /d "C:\Windows\Web\Wallpaper\Nature\img6.jpg" /fREM Unload the default profile hiveREG UNLOAD HKU\HiveI'm sorry Mr. Jinje! I did read your link! That was a typo! I pasted a code snippet from an earlier attempt! I did find and correct that error *BEFORE* I posted that response. So the script I ran actually did use 'REG ADD "HKU\Hive.......' and it still did not work. I have edited my above post to remove the typo. Just to make sure it *would* work I decided to make another script and apply the registry key for the user currently logged in. Here's my script::: Change WallpaperREG ADD "HKCU\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "C:\Windows\Web\Wallpaper\Nature\img6.jpg" /f:: Refresh User Settings:%SystemRoot%\System32\RUNDLL32.EXE user32.dll This did change the registry key for the current user and (after a reboot) the custom wallpaper *was* applied! Now if I could just figure out why it is failing when I edit "C:\Users\Default\NTUSER.DAT". I did notice when I checked the registry entry for the first time after I logged into the new user account (that was supposed to contain my custom settings) I found that it was overwritten by the default wallpaper location which is "C:\Users\<Username>\Appdata\Roaming\Microsoft\Windows\Themes\TranscodedWallpaper.jpg". So in short, if I modify the registry entry manually, it gets reflected properly. This suggests that Windows 7 is "doing something" to change my settings when a new user logs in for the first time.Thoughts? Link to comment Share on other sites More sharing options...
zeusabj Posted March 7, 2010 Author Share Posted March 7, 2010 (edited) Well, I knew I wasn't crazy, check this out:http://social.msdn.microsoft.com/Forums/en/windowsuidevelopment/thread/1703c3f4-a2ea-4c4a-a73f-a93e6d51b2bbSo looks like my only solution is to overwrite this wallpaper file:Which seems like a rather sloppy approach, but hey if it works.... Edited March 7, 2010 by zeusabj Link to comment Share on other sites More sharing options...
maxXPsoft Posted March 7, 2010 Share Posted March 7, 2010 (edited) C:\Windows\Web\Wallpaper\Windows\img0.jpgyes I do that also and replace it everywhere on the drive. You'll find it in several more places4 places on a 64 bit and then you can also replace AppData\Roaming\Microsoft\Windows\Themes\TranscodedWallpaper.jpg with same. Edited March 7, 2010 by maxXPsoft Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now