• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 527
  • Last Modified:

How to add/edit DWORD values

How do I do this? It seems if I edit any values like this:

Dim Reg As Object
        Dim Value As Decimal
        Reg = CreateObject("wscript.shell")
        Value = 1
        Reg.RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr", Value)

It reverts the original DWORD value into a string value.
0
drakkarnoir
Asked:
drakkarnoir
  • 2
  • 2
1 Solution
 
DotNetLover_BaanCommented:
Hi there...
if I understood your problem right, here is the solution...

        Dim Reg As Object
        Dim Value As String
        Reg = CreateObject("wscript.shell")
        Value = "1"
        Reg.RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr", Value)

To return to normal setting...

        Dim Reg As Object
        Dim Value As String
        Reg = CreateObject("wscript.shell")
        Value = ""
        Reg.RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr", Value)

Let me know if this is what you want...
-Baan
0
 
drakkarnoirAuthor Commented:
Hmmm, no, not really. I just wanted to know how I could edit the registry without making DWORD values into strings after they change to any value.
0
 
DotNetLover_BaanCommented:
I am sorry to say that... but, your question is still not clear to me...
0
 
drakkarnoirAuthor Commented:
Hmm, ok let me try again.

The original registry key is of a DWORD value. However, when I change it with VB.NET ... it changes from DWORD type to String.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now