Re: UserAccountContol Question... Please Help.....

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Roger (hainesr3_at_nationwide.com)
Date: 03/12/04


Date: Fri, 12 Mar 2004 11:06:29 -0600

Thanks for your quick response. I guess I need to go back and re-educate myself on binary. When you refer to the first bit mask and the second bit mask for your example. Are you talking about to completely different bit masks? 1011 and 0010

The reason I ask is when you say "The second bit may be the one of interest to you" refering to the first "bit mask". I was thinking that
the second bit would be ( in red below). I'm way off base here aren't I.

1011

"Stivie S." <stefan.suesser@computacenter.com> wrote in message news:6A82E122-87F4-4D6F-9D00-FF9C1E2E5B89@microsoft.com...
> Hi,
>
> the "UserAccountControl" is implemented as a bit masks, like some other properties, too. Each bit in the bit masks represents a certain setting, and you set the individual bits in the bit mask to either 0 or 1 to enable or disable a setting.
> To work with bit masks, you neet the boolean operators AND, OR or XOR. I do not know if you have every worked with boolean operators, but here is an example:
> Let's say, you have a bit mask consisting of 4 bits. The bit mask is currently set to "1011". The second bit may be the one of interest to you - so you want to check if this second bit is set. The setting of the second bit is written as "0010" in the bit mask. You check the setting of the second bit by combining both bit masks (the actual setting and the bit of interest) with the boolean AND operator. The result will be: 1011 AND 0010 = 0010 - the result is exactly the bit mask of the setting you are interested in!!! Why that? When using the boolean AND operator, you can get the result by calculating "if the first bit of the bit mask and the first bit of the setting of interest are the same, the result is 1 (TRUE=equal), otherwise the result is 0(FALSE=not equal)", and doing this with every bit.
> That's why the script has the code line "If objHash(Key) And intUAC Then..." - the meaning of this line is simple: when the boolean AND comparison of the UserAccountControl (intUAC) and a particular setting (objHash(key) is true, then the property is enabled - when the comparison is false, the property is disabled.
> Sounds complicated? It is in deed simple, I think, but you should have some maths background from school about boolean operators.



Relevant Pages

  • Re: UserAccountContol Question... Please Help.....
    ... You test by "And"ing the value with a bit mask. ... ' Test flag for password not required. ... If (lngFlag And ADS_UF_PASSWD_NOTREQD) 0 Then ... I do not know if you have every worked with boolean operators, ...
    (microsoft.public.scripting.vbscript)
  • Re: Date Questions
    ... >can 05 automaticaly be entered in the end since all dates refer to 2005 so ... Just get rid of the date mask, and Access will fill in the year ... in a date/time field. ... Prev by Date: ...
    (microsoft.public.access.gettingstarted)
  • Re: Subnetting Question
    ... that I believe what you refer to as the 'inherent error' is ... address, mask, address, mask, address, mask, I assumed that the masks ... necessarily went with the preceeding addresses. ...
    (microsoft.public.cert.exam.mcsa)
  • Date Questions
    ... can 05 automaticaly be entered in the end since all dates refer to 2005 so ... What mask do I need ... Dimitris ... Prev by Date: ...
    (microsoft.public.access.gettingstarted)