Edit Default User NTUSER.DAT

J

Johan

For very good reasons I want to be able to edit the
Defualt User NTUSER.dat file in a script or command line.

How can this be done, I've looked at SO MANY ways but
can't find a solution.

Please help.
 
O

Olof Lagerkvist

Johan said:
For very good reasons I want to be able to edit the
Defualt User NTUSER.dat file in a script or command line.

How can this be done, I've looked at SO MANY ways but
can't find a solution.

The normal way is to use regedt32.exe application and "load hive" menu
option to load the file into a registry key and then edit that key in
usual way, then unload the hive again.

But if you want to do it from a script or command line, you need the
reg.exe command line utility. The reg.exe is included in Windows XP/2003
and it is available as a resource kit utility for NT/2000. (Download the
resource kit support tools for NT 4 to get it.)

First execute
reg load HKU\DefaultUser "C:\Documents and Settings\Default User\ntuser.dat"
then make a normal .reg file and import it using "reg import" or
"regedit /s" and then execute
reg unload HKU\DefaultUser
 
J

Johan

Olof, this is exactly what I was looking for. I was so
close to getting there before.

It's still not quite working though.
I can load the ntuser.dat file into the hive ok
I then reg import my .reg file
I then reg query the key and it's all good
I then unload the hive again

But when I log off and login as a new user it hasn't
transferred into the new profile. What's gone wrong?

Cheers
-----Original Message-----


The normal way is to use regedt32.exe application and "load hive" menu
option to load the file into a registry key and then edit that key in
usual way, then unload the hive again.

But if you want to do it from a script or command line, you need the
reg.exe command line utility. The reg.exe is included in Windows XP/2003
and it is available as a resource kit utility for NT/2000. (Download the
resource kit support tools for NT 4 to get it.)

First execute
reg load HKU\DefaultUser "C:\Documents and
Settings\Default User\ntuser.dat"
 
O

Olof Lagerkvist

Johan said:
Olof, this is exactly what I was looking for. I was so
close to getting there before.

It's still not quite working though.
I can load the ntuser.dat file into the hive ok
I then reg import my .reg file

Your .reg file must change keys under your loaded hive instead of the
current user's profile, so everywhere in the .reg file where it normally
would have been HKEY_CURRENT_USER, replace it with HKEY_USERS\DefaultUser.
I then reg query the key and it's all good
I then unload the hive again

But when I log off and login as a new user it hasn't
transferred into the new profile. What's gone wrong?

You can check the imported values under HKEY_USERS\DefaultUser using
regedit before you unload the hive.
 
J

Johan

Olof, my reg file containts the following:

[HKEY_USERS\DefaultUser\Software\Microsoft\Command
Processor]
"DisableUNCCheck"=dword:00000001

It appears fine when I check it with Regedit, but it's
just not apearing when creating a new profile.
 
O

Olof Lagerkvist

Johan said:
Olof, my reg file containts the following:

[HKEY_USERS\DefaultUser\Software\Microsoft\Command
Processor]
"DisableUNCCheck"=dword:00000001

It appears fine when I check it with Regedit, but it's
just not apearing when creating a new profile.

Strange, is it a terminal server in application mode? If so you can put
the setting in [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Terminal Server\Install\Software\Microsoft\Command
Processor] instead.

I dont know any other methods except importing a .reg-file from a logon
script or something.
 
J

Johan

No it's not using Terminal Services, and I don't think
importing the reg file in the login script to the current
user will work. I know it's strange, I'll have another
look. We have a very hybrid system here and I can only
guess that one of the other systems somehow is messing
things up.

Thank you for all your help, I have got further here than
the months of writing things on the many forums on the net.

Cheers,
Johan
-----Original Message-----
Johan said:
Olof, my reg file containts the following:

[HKEY_USERS\DefaultUser\Software\Microsoft\Command
Processor]
"DisableUNCCheck"=dword:00000001

It appears fine when I check it with Regedit, but it's
just not apearing when creating a new profile.

Strange, is it a terminal server in application mode? If so you can put
the setting in [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Terminal
Server\Install\Software\Microsoft\Command
Processor] instead.

I dont know any other methods except importing a .reg- file from a logon
script or something.
 
J

Johan

Ok the Default User ntuser.dat file is being updated, but
I have found that they are not being passed down to new
USERS due to not enough permissions on the reg key. I
have created a secedit .inf file to modify the rights when
REG LOAD holds them in the temp hive, but when released
these are not being passed down...any suggestions?
-----Original Message-----
No it's not using Terminal Services, and I don't think
importing the reg file in the login script to the current
user will work. I know it's strange, I'll have another
look. We have a very hybrid system here and I can only
guess that one of the other systems somehow is messing
things up.

Thank you for all your help, I have got further here than
the months of writing things on the many forums on the net.
Cheers,
Johan

-----Original Message-----
Johan said:
Olof, my reg file containts the following:

[HKEY_USERS\DefaultUser\Software\Microsoft\Command
Processor]
"DisableUNCCheck"=dword:00000001

It appears fine when I check it with Regedit, but it's
just not apearing when creating a new profile.

Strange, is it a terminal server in application mode? If so you can put
the setting in [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Terminal
Server\Install\Software\Microsoft\Command
Processor] instead.

I dont know any other methods except importing a .reg- file from a logon
script or something.
 
O

Olof Lagerkvist

Johan said:
Ok the Default User ntuser.dat file is being updated, but
I have found that they are not being passed down to new
USERS due to not enough permissions on the reg key. I
have created a secedit .inf file to modify the rights when
REG LOAD holds them in the temp hive, but when released
these are not being passed down...any suggestions?

You mean that ntuser.dat in Default User directory contains your updated
settings but then a new user profile does not get your settings? That
sound strange. When a new user profile is created, ntuser.dat is copied,
loaded and permissions are automatically changed to allow users full
control to their own registries.

Right now I have no more ideas.
 
J

Johan

Olof, you have been such great help. I really didn't
expect this thread to continue when it's not on the first
page :blush:)

This completely baffles me also. I know what you say is
correct. It's weird that I can log in with a new account
that has Admin rights and it works fine, but anything with
rights less than Admin it won't. It will still copy the
ntuser.dat file down, but it just won't have any of the
changes? I find it weird that it doesn't keep the security
permissions once unloaded from the hive?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top