By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,106 Members | 1,092 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,106 IT Pros & Developers. It's quick & easy.

HELP NEEDED : Service socket and event log

P: n/a

I wrote a windows service with a socket that receives files and once
a file has been received it tries to execute it.
My problem comes from execution because nothing happens.

I have checked three times path and that kind of things but still
nothing.Here is what I do in my method that analyze data :

private void ProcessClientData(String oneLine)

//================================================== ======//
// Execute script files(.bat ONLY)
string strCmdLine;
string strDebug;
bool bRet = false;

strCmdLine = "/C " + DEFAULT_FILE_STORE_LOC + m_strCurFile;

System.Diagnostics.EventLog.WriteEntry("BorneAdmin ", "CmdLine=" +

System.Diagnostics.Process proc; // Declare New Process
proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents = false;

//proc.StartInfo.UseShellExecute = false;
proc.StartInfo.FileName = "cmd.exe";
proc.StartInfo.Arguments = strCmdLine;
System.Diagnostics.EventLog.WriteEntry("BorneAdmin ","proc.Start=BEFORE");
bRet = proc.Start();
System.Diagnostics.EventLog.WriteEntry("BorneAdmin ","proc.Start=AFTER");
m_clientSocket.Send(BitConverter.GetBytes(m_totalC lientDataSize));


When I look at logs I can see that proc.Start is execcuted.
By the way what is the equivalent function in C# of (csTmp.Format("%d",
bRet) )??? (I have started c# one hour ago but I am experienced in C++/MFC)

thnaks in advance
Nov 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.