473,386 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How do you make a REG_DWORD?

Dim rk As RegistryKey =
Registry.LocalMachine.CreateSubKey("Software\Micro soft\Windows\CurrentVersio
n\WindowsUpdate\Auto Update")

rk.SetValue("AUOptions", "4")

In the above example I am setting AUOptions to a value of 4. By default it
created a REG_SZ but I need it to be a REG_DWORD.

I can't for the life of me find anything written about this. Can anyone
offer some advice?
Nov 20 '05 #1
4 1726
"Ty Moffett" <tm******@solarc.com> schrieb
Dim rk As RegistryKey =
Registry.LocalMachine.CreateSubKey("Software\Micro soft\Windows\CurrentVersio n\WindowsUpdate\Auto Update")

rk.SetValue("AUOptions", "4")

In the above example I am setting AUOptions to a value of 4. By
default it created a REG_SZ but I need it to be a REG_DWORD.

I can't for the life of me find anything written about this. Can
anyone offer some advice?


You are passing a string. That's why a string is stored. Pass a numerical
value and a DWORD will be stored:
rk.SetValue("AUOptions", 4)
--
Armin

http://learn.to/quote
http://www.plig.net/nnq/nquote.html

Nov 20 '05 #2
I found that if you do this

rk.SetValue("AUOptions", 4)

It automatically makes it a DWORD, but I don't really understand why.

"Ty Moffett" <tm******@solarc.com> wrote in message
news:eV**************@TK2MSFTNGP11.phx.gbl...
Dim rk As RegistryKey =
Registry.LocalMachine.CreateSubKey("Software\Micro soft\Windows\CurrentVersio n\WindowsUpdate\Auto Update")

rk.SetValue("AUOptions", "4")

In the above example I am setting AUOptions to a value of 4. By default it created a REG_SZ but I need it to be a REG_DWORD.

I can't for the life of me find anything written about this. Can anyone
offer some advice?

Nov 20 '05 #3
Did you try:
rk.SetValue("AUOptions", 4)

?

According to thne documentation on SetValue:
"Values allowed in the registry can be DWORD, binary, and string."
Jonathan
http://thinstall.com/help/index.html...tframework.htm
"Ty Moffett" <tm******@solarc.com> wrote in message
news:eV**************@TK2MSFTNGP11.phx.gbl...
Dim rk As RegistryKey =
Registry.LocalMachine.CreateSubKey("Software\Micro soft\Windows\CurrentVersio n\WindowsUpdate\Auto Update")

rk.SetValue("AUOptions", "4")

In the above example I am setting AUOptions to a value of 4. By default it created a REG_SZ but I need it to be a REG_DWORD.

I can't for the life of me find anything written about this. Can anyone
offer some advice?

Nov 20 '05 #4
"Ty Moffett" <tm******@solarc.com> schrieb
I found that if you do this

rk.SetValue("AUOptions", 4)

It automatically makes it a DWORD, but I don't really understand
why.


Because it's a numerical value, not a string.
--
Armin

http://learn.to/quote
http://www.plig.net/nnq/nquote.html

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: musicloverlch | last post by:
I used to be able to create PDFs, automatically save them to a file, and mail them out to people. This was on Access 97 with Windows NT. We've changed to Windows XP and Access 2003. Doesn't work...
2
by: DavidP | last post by:
Hello, I am trying to use VBScript to set an entry in the registry. Here is a snippet of what I am trying to do: WshShell.RegWrite "HKEY_CLASSES_ROOT\Powerpoint.Show.8\BrowserFlags", "a"...
2
by: elitecodex | last post by:
Hey everyone. I have a function that reads in a registry value (for the windows firewall) and one that disables it. Reading the value works perfectly. However, I am getting an access denied...
1
by: lalanthaj | last post by:
How can I create a ODBC driver through the VB coding?
5
by: nexes | last post by:
At my work we have a number of access db's and they all link to the same systemdb, we have at leasst 200 computers and they are perodicly replace and or loose the systemdb location. I have done a...
0
by: Peterwkc | last post by:
Hello everybody, i a C/C++ programmer but i have a visual basic question becasue my computer is being attacked by someone else. I don't know what is the function of the code. Could oyu please...
2
by: iqbalash | last post by:
-------------------------------------------------------------------------------- Please tell me how can I make DSN programatically to a password protected Access DB. Thanks Best Regards,...
4
by: CDMAPoster | last post by:
In: http://groups.google.com/group/comp.databases.ms-access/msg/f06bd4c45037ef29 Lyle wrote: :Terry Kreft wrote: : :>Suck it and See? :
1
by: billelev | last post by:
Here is some code that I have adapted slightly. It allows a report to be printed to a specific location. It works by calling SaveReportAsPDF and specifying the access report name, and the root...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.