Jump to content

Need help with setting some defaults for all users in Windows 7...


Recommended Posts

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.aspx

I 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\Default

For 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


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

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.

MrJinje

You can add all that stuff directly as he is trying to do. :whistle:

Link to comment
Share on other sites

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

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.

MrJinje

You can add all that stuff directly as he is trying to do. :whistle:

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

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 by MrJinje
Link to comment
Share on other sites

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

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 correct

For machine settings it's different \Windows\System32\config\SOFTWARE

EDIT: 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 by maxXPsoft
Link to comment
Share on other sites

So I changed my code to this:

REM Load the default profile hive
REG LOAD HKU\Hive C:\Users\Default\NTUSER.DAT

REM Configure the default user profile
REG ADD "HKU\Hive\Control Panel\Desktop" /v WallPaper /t REG_SZ /d "C:\Windows\Web\Wallpaper\Nature\img6.jpg" /f

REM Unload the default profile hive
REG UNLOAD HKU\Hive

All 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 by zeusabj
Link to comment
Share on other sites

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 hive
REG LOAD HKU\Hive C:\Users\Default\NTUSER.DAT

REM Configure the default user profile
REG ADD "HKU\Hive\Control Panel\Desktop" /v WallPaper /t REG_SZ /d "C:\Windows\Web\Wallpaper\Nature\img6.jpg" /f

REM Unload the default profile hive
REG UNLOAD HKU\Hive

Edited by MrJinje
Link to comment
Share on other sites

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 hive
REG LOAD HKU\Hive C:\Users\Default\NTUSER.DAT

REM Configure the default user profile
REG ADD "HKU\Hive\Control Panel\Desktop" /v WallPaper /t REG_SZ /d "C:\Windows\Web\Wallpaper\Nature\img6.jpg" /f

REM Unload the default profile hive
REG UNLOAD HKU\Hive

I'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 Wallpaper
REG 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

Well, I knew I wasn't crazy, check this out:

http://social.msdn.microsoft.com/Forums/en/windowsuidevelopment/thread/1703c3f4-a2ea-4c4a-a73f-a93e6d51b2bb

So looks like my only solution is to overwrite this wallpaper file:

Which seems like a rather sloppy approach, but hey if it works....

Edited by zeusabj
Link to comment
Share on other sites

C:\Windows\Web\Wallpaper\Windows\img0.jpg

yes I do that also and replace it everywhere on the drive. You'll find it in several more places

4 places on a 64 bit and then you can also replace

AppData\Roaming\Microsoft\Windows\Themes\TranscodedWallpaper.jpg with same.

Edited by maxXPsoft
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...