我想执行以下多个命令:
cd C:\Informatica\9.0\clients\PowerCenterClient\client\bin pmrep connect -r rs_01_lab -d Domain_DELLBANPDB01 -n etl_designer -x etl123
使用C#编写了以下代码:
cd C:\Informatica\9.0\clients\PowerCenterClient\client\bin pmrep connect -r rs_01_lab -d Domain_DELLBANPDB01 -n etl_designer -x etl123
使用C#编写了以下代码:
Process p = new Process();
ProcessStartInfo info = new ProcessStartInfo("cmd.exe");
info.RedirectStandardInput = true;
info.UseShellExecute = false;
p.StartInfo = info;
p.Start();
using (StreamWriter sw = p.StandardInput)
{
if (sw.BaseStream.CanWrite)
{
sw.WriteLine("cd C:\Informatica\9.0\clients\PowerCenterClien\client\bin");
sw.WriteLine("pmrep");
sw.WriteLine("connect -r rs_01_lab -d Domain_DELLBANPDB01 -n etl_designer -x etl123");
StreamReader SR = p.StandardOutput;
string myString = SR.ReadToEnd();
sw.WriteLine("mypassword");
sw.WriteLine("use mydb;");
}
}
但我不会在命令提示符中编写命令。
能否请您帮助我解决这个问题。
先行致谢, Sunayana