Click here to Skip to main content
15,917,642 members
Home / Discussions / C#
   

C#

 
Question[Solved] Windows Service - problem with write file at scheduled time Pin
emma.sun.sts13-Nov-13 20:06
emma.sun.sts13-Nov-13 20:06 
AnswerRe: Windows Service - problem with write file at scheduled time Pin
Bernhard Hiller13-Nov-13 20:56
Bernhard Hiller13-Nov-13 20:56 
GeneralRe: Windows Service - problem with write file at scheduled time Pin
emma.sun.sts13-Nov-13 21:25
emma.sun.sts13-Nov-13 21:25 
GeneralRe: Windows Service - problem with write file at scheduled time Pin
Bernhard Hiller13-Nov-13 21:29
Bernhard Hiller13-Nov-13 21:29 
GeneralRe: Windows Service - problem with write file at scheduled time Pin
emma.sun.sts13-Nov-13 21:39
emma.sun.sts13-Nov-13 21:39 
GeneralRe: Windows Service - problem with write file at scheduled time Pin
Eddy Vluggen13-Nov-13 21:48
professionalEddy Vluggen13-Nov-13 21:48 
GeneralRe: Windows Service - problem with write file at scheduled time Pin
Pete O'Hanlon14-Nov-13 0:14
mvePete O'Hanlon14-Nov-13 0:14 
Questionread only Pin
seeker6213-Nov-13 8:41
seeker6213-Nov-13 8:41 
SuggestionRe: read only Pin
Richard MacCutchan13-Nov-13 8:56
mveRichard MacCutchan13-Nov-13 8:56 
GeneralRe: read only Pin
seeker6213-Nov-13 9:13
seeker6213-Nov-13 9:13 
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 

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.