string OrginalCreateTransformMsi = "D:\\Desktop\\Jonty-transform creator\\MSITransformTool.exe"; string strMSIName = "D:\\Desktop\\SetUps\\Orca.Msi";
private void ExecuteCommandLine(string strCMDText) { //System.Diagnostics.Process.Start("CMD.exe", strCmdText); string tempGETCMD = null; Process CMDprocess = new Process(); ProcessStartInfo StartInfo = new ProcessStartInfo(); StartInfo.FileName = "cmd"; //starts cmd window //StartInfo.WindowStyle = ProcessWindowStyle.Hidden; StartInfo.CreateNoWindow = true; StartInfo.RedirectStandardInput = true; StartInfo.RedirectStandardOutput = true; StartInfo.UseShellExecute = false; //required to redirect CMDprocess.StartInfo = StartInfo; CMDprocess.Start(); StreamReader SR = CMDprocess.StandardOutput; StreamWriter SW = CMDprocess.StandardInput; SW.WriteLine("@echo on"); SW.WriteLine(strCMDText); //the command you wish to run..... //SW.WriteLine("cd C:\\Program Files"); //insert your other commands here SW.WriteLine("exit"); //exits command prompt window tempGETCMD = SR.ReadToEnd(); //returns results of the command window SW.Close(); SR.Close(); } ExecuteCommandLine(OrginalCreateTransformMsi +" " + strMSIName);
Process.Start(OrginalCreateTransformMsi, strMSIName);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)