Is there a way to edit the security registry (HKLM:\SOFTWARE\Microsoft\MSDTC\Security) programmatically in vb.net?
I have tried the following to test but it does not seem to work.
This is an example of the NetworkDtcAccess registry.
Dim regKey As RegistryKey
regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\MSDTC\Security", True)
I am running visual studio as administrator and I am the administrator of the computer
I had a suggest of running the commands as a powershell script but that bring up a lot of unnecessary problems to overcome in the code. So I tested and found if you run the command one by one it works. I I tried to apply this in visual studio, it does not give me any errors but the changes is not applied. I don't know if windows is blocking me. Here is the example.
Dim objProcess As New System.Diagnostics.Process()
Dim startInfo As System.Diagnostics.ProcessStartInfo = New ProcessStartInfo
startInfo.FileName = "powershell.exe"
startInfo.Arguments = "Set-ItemProperty -Path
HKLM:\SOFTWARE\Microsoft\MSDTC\Security -Name NetworkDtcAccess -Value 1 -ErrorAction
startInfo.RedirectStandardOutput = True
startInfo.RedirectStandardError = True
startInfo.UseShellExecute = False
startInfo.CreateNoWindow = False
objProcess.StartInfo = startInfo
Dim output As String = objProcess.StandardOutput.ReadToEnd()
Dim errors As String = objProcess.StandardError.ReadToEnd()
Is it possible to edit the security registry in windows?