how to execute cmd commands using asp.net
Posted on 2010-11-10
hi i need to execute the dnscmd command on the webserver, i have impersonate set to login as windows user that have the permissions set too.
ii also tryed this 2 way:
'Dim myprocess As System.Diagnostics.Process = New System.Diagnostics.Process()
'myprocess.StartInfo.FileName = "dnscmd.exe"
'myprocess.StartInfo.RedirectStandardOutput = True
'myprocess.StartInfo.UseShellExecute = False
'myprocess.StartInfo.CreateNoWindow = True
'myprocess.StartInfo.Arguments = " /zoneadd aaaaa.com /primary /file aaaaa.com.dns"
'Dim startInfo As New ProcessStartInfo("C:\Windows\System32\dnscmd.exe")
'startInfo.Arguments = "/zoneadd aaaaa.com /primary /file aaaaa.com.dns"
none of those are working. the syntax is right i check it. i did myself on the cmd this syntax and created the dns record. but using the command on the asp.net code is not working.