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

Registry
plus

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

RegSetDword and Setting Last Bit to 0

Keywords: 	  RegSetDword

Question:

I have a Dword value in my registry, and I want to set the last bit in the value, no matter what it is currently set to (would be either a 0 or a 1), to a 0. How do I do that?

Answer:

In the example below, substitute your registry handle and paths in the "..." slots:
	val=RegQueryDword(...,...)
	val=val & (~1)
	RegSetDword(...,...,val)

Article ID:   W14289
Filename:   RegSetDword and Setting Last Bit to 0.txt
File Created: 1999:10:26:11:23:06
Last Updated: 1999:10:26:11:23:06