Click here to Skip to main content
15,888,984 members
Home / Discussions / C#
   

C#

 
GeneralRe: read only Pin
Richard MacCutchan13-Nov-13 9:29
mveRichard MacCutchan13-Nov-13 9:29 
GeneralRe: read only Pin
seeker6213-Nov-13 9:47
seeker6213-Nov-13 9:47 
GeneralRe: read only Pin
Richard MacCutchan13-Nov-13 10:42
mveRichard MacCutchan13-Nov-13 10:42 
GeneralRe: read only Pin
seeker6213-Nov-13 10:49
seeker6213-Nov-13 10:49 
GeneralRe: read only Pin
Richard MacCutchan13-Nov-13 10:57
mveRichard MacCutchan13-Nov-13 10:57 
GeneralRe: read only Pin
Ron Nicholson14-Nov-13 3:24
professionalRon Nicholson14-Nov-13 3:24 
GeneralRe: read only Pin
Nicholas Marty15-Nov-13 4:49
professionalNicholas Marty15-Nov-13 4:49 
AnswerThe system cannot find the file specified for process.start(). Pin
subhendun dan13-Nov-13 4:53
subhendun dan13-Nov-13 4:53 
I am trying to develop a tool which will add a host into the DNS server calling dnscmd.exe. I am assigning the property FileName as "dnscmd.exe" and pass the required i/p parameters. I did call nslookup.exe same way as I have called dnscmd.exe but in case of nslookup.exe code is working properly but in case of dnscmd.exe it's throwing exception while starting the process (here p.Start()) with message as "The system cannot find the file specified" .I am sharing the code snippet in top.

I have uncomment the WorkingDirectory and FileName (with fully qualified path of dnscmd) but still got the the same error. Someone please reply on my post and provide the resolution as I'll implement it ASAP. Thanks in advance

C#
Public bool AddtoDns(IStore iStr)
        {
            #region "Comment for Testing"

            bool isAdded = true;
            string strTid = "T00000013";
			string strDnsServerName= "OD-EV-W-DC-5.7-11T.COM";
			string strZoneName= "7-11t.com";
			string strIP= "10.172.13.10"
            System.Diagnostics.Process p = new System.Diagnostics.Process();

            try
            {                
                if (!CheckDnsEntry(iStr))
                {
                    //p.StartInfo.WorkingDirectory = @"C:\Windows\System32";
                    //p.StartInfo.FileName = @"C:\Windows\System32\dnscmd.exe";
                    p.StartInfo.FileName = "dnscmd.exe";
                    p.StartInfo.Arguments = strDnsServerName + " " + "/RecordAdd" + " " + strZoneName + " " + strTid + " " + "A" + " " + strIP;
                    p.StartInfo.UseShellExecute = false;
                    p.StartInfo.CreateNoWindow = true;
                    p.Start();

                    p.WaitForExit();

                    isAdded = true;
                }
                else
                {
                    isAdded = false;
                }
                return isAdded;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                p.Dispose();
            }
            #endregion

            //return true;
        }

GeneralRe: The system cannot find the file specified for process.start(). Pin
OriginalGriff13-Nov-13 5:39
mveOriginalGriff13-Nov-13 5:39 
GeneralRe: The system cannot find the file specified for process.start(). Pin
subhendun dan15-Nov-13 2:00
subhendun dan15-Nov-13 2:00 
GeneralRe: The system cannot find the file specified for process.start(). Pin
OriginalGriff15-Nov-13 3:52
mveOriginalGriff15-Nov-13 3:52 
QuestionC# chart height ,width based on data? Pin
Member 1027623012-Nov-13 19:57
Member 1027623012-Nov-13 19:57 
AnswerRe: C# chart height ,width based on data? Pin
Mycroft Holmes12-Nov-13 21:31
professionalMycroft Holmes12-Nov-13 21:31 
QuestionRe: C# chart height ,width based on data? Pin
Member 1027623012-Nov-13 22:19
Member 1027623012-Nov-13 22:19 
AnswerRe: C# chart height ,width based on data? Pin
Mycroft Holmes12-Nov-13 23:24
professionalMycroft Holmes12-Nov-13 23:24 
AnswerRe: C# chart height ,width based on data? Pin
GuyThiebaut12-Nov-13 23:41
professionalGuyThiebaut12-Nov-13 23:41 
GeneralRe: C# chart height ,width based on data? Pin
Member 1027623013-Nov-13 0:16
Member 1027623013-Nov-13 0:16 
Questionnearest postcode Pin
Member 1037988612-Nov-13 16:58
Member 1037988612-Nov-13 16:58 
AnswerRe: nearest postcode Pin
Mycroft Holmes12-Nov-13 21:28
professionalMycroft Holmes12-Nov-13 21:28 
GeneralRe: nearest postcode Pin
Member 1037988613-Nov-13 2:16
Member 1037988613-Nov-13 2:16 
QuestionUnit Testing with Serial Port Pin
Blubbo12-Nov-13 9:35
Blubbo12-Nov-13 9:35 
AnswerRe: Unit Testing with Serial Port Pin
Ron Beyer12-Nov-13 17:46
professionalRon Beyer12-Nov-13 17:46 
GeneralRe: Unit Testing with Serial Port Pin
Blubbo12-Nov-13 22:56
Blubbo12-Nov-13 22:56 
AnswerRe: Unit Testing with Serial Port Pin
Blubbo12-Nov-13 23:03
Blubbo12-Nov-13 23:03 
AnswerRe: Unit Testing with Serial Port Pin
Marco Bertschi13-Nov-13 0:15
protectorMarco Bertschi13-Nov-13 0:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.