Solved

How to add/edit DWORD values

Posted on 2004-08-25
4
497 Views
Last Modified: 2006-11-17
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
Comment
Question by:drakkarnoir
  • 2
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
DotNetLover_Baan earned 500 total points
ID: 11898380
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
 

Author Comment

by:drakkarnoir
ID: 11898448
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
 
LVL 18

Expert Comment

by:DotNetLover_Baan
ID: 11898503
I am sorry to say that... but, your question is still not clear to me...
0
 

Author Comment

by:drakkarnoir
ID: 11899255
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

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question