You should not be using the Xor function with UserFlags bit setting.

To set a any bit: $UserFlags | $BitValue
To clear any bit: $UserFlags & ~$BitValue.

All the bit value are listed on my site: http://home.comcast.net/~habullock/Win32Admin.htm#User

You can use the hex value or the decimal values.
_________________________
Home page: http://www.kixhelp.com/hb/