tomlinsorm
asked on
Visual Basic question
How can I use the RegLoadKey API call in a Visual Basic 4.0 to load a Windows NT 4.0 user profile hive? If possible, please give a detailed example.
ASKER
On going to http://www.karland.com/registry, I found no mention whatsoever that mentioned RegLoadKey or anything else to load an NT 4.0 user profile hive.
32bit call to a registry is a 32bit call. I'm not using RegLoadKey, but there are other 32bit registry calls there that do the exact same thing..
L8r,
Chizl
L8r,
Chizl
What exactly is it that you want to do? Will it be enough if I write you a sample on how to load it and how to remove it from memory when done with it?
ASKER
My apologies if I wasn't specific enough. I would like to write a VB4 program that will load and unload an abitrary user's profile hive (c:\winnt\profiles\usernam e\ntuser.d at)into the registry under the HKEY_USERS\username key. In addition, I hope to be able to do this from the command line. All I need to know are the command(s) to load the hive. It's similiar to what can be accomplished by going to regedt32, selecting HKEY_USERS, going to File and clicking "Load Hive", giving it the path c:\winnt\profiles\username \ntuser.da t and telling WinNT it's arbitrary name under the KEY_USERS key (ie. the username). Any and all help has been and is appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you, y96andha, for your answer. It went above and beyond the required.
y96andha...
Is this also possible in Win95?
L8r,
Chizl
Is this also possible in Win95?
L8r,
Chizl
The docs say that the RegLoadKey function is supported in Windows 95. So it should be possible. The other functions are not supported though, so I guess that just
Debug.Print "RegLoadKey "; RegLoadKey(HKEY_USERS, "tobias" & Chr(0), "f:\winnt\profiles\Tobias\ ntuser.dat " & Chr(0))
should be enough on Win95. I haven't tested it though.
Debug.Print "RegLoadKey "; RegLoadKey(HKEY_USERS, "tobias" & Chr(0), "f:\winnt\profiles\Tobias\
should be enough on Win95. I haven't tested it though.
ASKER
FYI, I was not able to get it to work under Win95, even when I renamed the "ntuser.dat" file to "ntuser.". I may have been going about it the wrong way, though.
I don't think you can load an NT profile under Win95, but a Win95 profile should be fine. NT has security settings for the registry hives, Win95 has not, so the file formats are probably different between them.
L8r,
Chizl