Host에 있는 Script file등을 Process.Start로 실행시켜 보자.

 

#region "서버로 접근하여 특정 파일 실행시키기 : ExecuteServerFile"
/// ////////////////////////////////////////////////////////////
/// Makeby : HJKIM@FROM30 200900903
/// FuncName: StartHostFile
/// review : This function can start from server which is USER decide.
/// apply : System.Diagnostics.Process.Start function user method,
/// ////////////////////////////////////////////////////////////
public bool StartHostFile(string strServerFile)
{
// 1. check target
string target=null;
if (strServerFile.Contains("/"))
target = AdjustDir(strServerFile);

string strArgument = string.Format("/c rsh {0} -l {1} {2}", axSinfo.hostname, axSinfo.userid, target);

ProcessStartInfo startInfo = new ProcessStartInfo("cmd.exe");
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.Arguments = strArgument;
Process.Start(startInfo);
//System.Diagnostics.Process.Start("cmd.exe",strAgument);

return true;
}
#endregion

 

 

+ Recent posts