troubleshooting Question

how to execute cmd commands using asp.net

Avatar of rafaelrgl
rafaelrgl asked on
ASP.NETMicrosoft IIS Web ServerWindows Server 2008
13 Comments2 Solutions1105 ViewsLast Modified:
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:

1)
        '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"
        'myprocess.Start()

2)
        'Dim startInfo As New ProcessStartInfo("C:\Windows\System32\dnscmd.exe")
        'startInfo.Arguments = "/zoneadd aaaaa.com /primary /file aaaaa.com.dns"
        'Process.Start(startInfo)

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.
ASKER CERTIFIED SOLUTION
HainKurt
Sr. System Analyst

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 13 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros