Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: hive file Registry RegUnloadHive wntAccessAdd security 1526
Also, I need a way to dynamically import a previously exported selected branch of the registry. Thanks.
To use the RegLoadHive function. Use the "Search" in the Windows Interface Language help file to find it.
Regarding your other question, dynamically importing a previously exported branch (a *.REG file, which is a text file) (as opposed to a hive which is a binary file):
Is it saved as a *.reg file? If so, you can import a branch using the following command:
RunWait("regedit.exe","/s mystuff.reg")By the way, to export a REG file in Windows 95/NT, you can use the following command line:
run('regedit.exe', '/e "c:\temp\myfile.reg" "HKEY_LOCAL_MACHINE\Control Panel"')This will save the registry subkey "Control Panel" under "HKEY_LOCAL_MACHINE" in a text file called "myfile.reg" in the "C:\TEMP" directory.
Unless I am misinterpreting RegLoadHive, RegLoadHive will allow me to restore a hive. I can't figure out how to save the hive after an install!
The syntax forRegUnloadHive, RegUnloadHive(handle, subkey) doesn't allow you to specifiy a filename.
Rather than export/import the entire registry, I thought I'd just export/import the hive.
RegUnloadHive simply disconnects the hive file from the registry.
It sounds like what you need to do is MAKE the hive file in the first place. In regedit (NT version but not in 95), on the Registry menu, there is a SAVE KEY that will make your hive file.
Is there a way to export Hives? Or a FAST routine I can use?
http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/Registry+How~to~Save~Hive~Files~in~Windows~95.txtWell we can read hives. We don't export them. 45 minutes sounds like a long time. How are you doing it?
You can send keystrokes to regedit to export hives (in NT), but I don't think that is what you want to do.
If you keep the hive file on the network server in the users directory it might just work without continual importing and exporting...
Here is the code sample:
RegLoadHive (@REGMACHINE, "Temp", "D:\WINNT\SYSTEM32\CONFIG\SYSTEM" ) If !RegExistKey (@REGMACHINE, "Temp\DISK") KEY = RegOpenKey (@REGMACHINE, "Temp") RegCreateKey (KEY, "DISK") RegCLoseKey (KEY) EndIf Key1 = RegOpenKey (@REGMACHINE, "Temp\DISK" ) RegSetBin (Key1, "[Information]", Value ) RegCLoseKey (Key1) RegUnloadHive (@REGMACHINE, "Temp")At the RegUnloadHive command, it is there that it says "Access Denied". Even if I go in Regedt32, I cannot unload the HIve, unless I delete the new Key created. But, if I do all those steps manually with regedt32, I don't have any problems.
RegLoadHive (@REGMACHINE, "Temp", "D:\WINNT\SYSTEM32\CONFIG\SYSTEM" )is:
D:\WINNT\SYSTEM32\CONFIG\SYSTEM*really* the name of a hive file ???
If yes, I would then check the security permissions carefully. Perhaps they are not getting inherited properly.
The wntAccessAdd functions in the NT network extender can modify security settings. Maybe regedit is automatically setting some permissions that regLoadHive is not.
Article ID: W13733
Filename: RegLoadHive - RegUnloadHive - and Running REG Files.txt
File Created: 2017:08:29:11:58:52
Last Updated: 2017:08:29:11:58:52