J
jam
Dear All,
I have a command process running xcopy in console, and now I want to execute
the program Rsync After the files are copied...how could i do??
Process p10=new Process();
p10.StartInfo.FileName = "cmd.exe";
p10.StartInfo.UseShellExecute = false;
// p.StartInfo.CreateNoWindow = true;
p10.StartInfo.RedirectStandardInput = true;
p10.StartInfo.RedirectStandardOutput = true;
p10.StartInfo.RedirectStandardError = true;
p10.Start();
p10.StandardInput.WriteLine("xcopy "+IISDir+"\\Chi\\swf
"+RootDir+"\\Chi\\swf /h /i /e /r /y ");
Console.WriteLine("xcopy "+IISDir+"\\Chi\\swf "+RootDir+"\\Chi\\swf /h
/i /e /r /y ");
p10.Close();
WriteToMessageFile("\nCopy Chi Folder is Done at "+DateTime.Now);
Process p11=new Process();
p11.StartInfo.FileName = "cmd.exe";
p11.StartInfo.UseShellExecute = false;
// p.StartInfo.CreateNoWindow = true;
p11.StartInfo.RedirectStandardInput = true;
p11.StartInfo.RedirectStandardOutput = true;
p11.StartInfo.RedirectStandardError = true;
p11.Start();
p11.StandardInput.WriteLine("run rsync");
Console.WriteLine("Rsync running");
p11.Close();
WriteToMessageFile("\nRsync is Done at "+DateTime.Now);
But I cannot make it wait for p10 to finish then start p11, how could it do?
this cannot be done with setting a time for p11 to start cos the file may
build up in swf folder after a while, I mean the copying time may become
longer.....
Jam
thanks
I have a command process running xcopy in console, and now I want to execute
the program Rsync After the files are copied...how could i do??
Process p10=new Process();
p10.StartInfo.FileName = "cmd.exe";
p10.StartInfo.UseShellExecute = false;
// p.StartInfo.CreateNoWindow = true;
p10.StartInfo.RedirectStandardInput = true;
p10.StartInfo.RedirectStandardOutput = true;
p10.StartInfo.RedirectStandardError = true;
p10.Start();
p10.StandardInput.WriteLine("xcopy "+IISDir+"\\Chi\\swf
"+RootDir+"\\Chi\\swf /h /i /e /r /y ");
Console.WriteLine("xcopy "+IISDir+"\\Chi\\swf "+RootDir+"\\Chi\\swf /h
/i /e /r /y ");
p10.Close();
WriteToMessageFile("\nCopy Chi Folder is Done at "+DateTime.Now);
Process p11=new Process();
p11.StartInfo.FileName = "cmd.exe";
p11.StartInfo.UseShellExecute = false;
// p.StartInfo.CreateNoWindow = true;
p11.StartInfo.RedirectStandardInput = true;
p11.StartInfo.RedirectStandardOutput = true;
p11.StartInfo.RedirectStandardError = true;
p11.Start();
p11.StandardInput.WriteLine("run rsync");
Console.WriteLine("Rsync running");
p11.Close();
WriteToMessageFile("\nRsync is Done at "+DateTime.Now);
But I cannot make it wait for p10 to finish then start p11, how could it do?
this cannot be done with setting a time for p11 to start cos the file may
build up in swf folder after a while, I mean the copying time may become
longer.....
Jam
thanks