string scriptDirectoryName = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), InstallerInfo.SCRIPTDIRECTORY);

//Scripts executing           

             ProcessStartInfo pi = new ProcessStartInfo("osql.exe");
            pi.WindowStyle = ProcessWindowStyle.Hidden;

            string osqlArgs = "-S " + System.Environment.MachineName + "\\" + InstallerInfo.MSDEINSTANCE +
                " -d master -U sa -P " + InstallerInfo.SAPWD + " -b -i ";

            foreach(string script in sequence)
            {
               
                    pi.Arguments = osqlArgs + "\"" + scriptDirectoryName + Path.DirectorySeparatorChar +
                                   "Queries" + Path.DirectorySeparatorChar + script + "\"" + " -o C:\\Temp\\" + script + ".log";
              

                Console.WriteLine(pi.Arguments);

                Process proc = Process.Start(pi);

                proc.WaitForExit();
               
            }

 

相关文章:

  • 2022-01-16
  • 2022-01-21
  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2022-01-04
猜你喜欢
  • 2021-12-22
  • 2021-04-25
  • 2021-07-20
  • 2021-07-07
  • 2021-12-11
  • 2021-11-06
相关资源
相似解决方案