WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

64-bit

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

RegOpenFlags and View-Flag Parameters

 Keywords: RegOpenFlags 32 64 32-bit 64-bit View Flag Registry Redirection 

Question:

I have a long WinBatch program that is supposed to run on the 32 and 64-bit systems. In that program I open and close the registry keys several times.

1. Do I have to set the RegOpenFlags anytime I open a new Registry key or setting it one time at the very top of the program will be enough?

2. If I already used RegOpenFlags, do I need to care about the View-Flag parameter in the Registry Commands?

Thanks so much for any help.

Answer:

RegOpenFlags needs only to be called once. Unless the script need to change it's registry view to get or set a value in the alternate registry view. If the entire script only requires one registry view then the answer is yes, you only need to call RegOpenFlags one time.

The optional View-Flag parameter in most of the registry functions will 'trump' the RegOpenFlags setting. However, if you do not specify the paramater or you set it to 0 it will use the view indicated by the last call to the RegOpenFlags. The parameter value of 0 can also causes a function to use the WinBatch default 64-bit view, if no call to RegOpenFlags has been made and setting the parameter to 0 is equivalent to omitting the parameter entirely.


Article ID:   W17649
Filename:   RegOpenFlags and View-Flag Parameters.txt
File Created: 2010:01:13:13:48:18
Last Updated: 2010:01:13:13:48:18