CLI命令和路径文件夹。

问题描述:

尊敬的各位成员;

我在应用程序中工作,使用德州仪器提供的文件.bat在我的微控制器中加载固件。 

I'm working in application to load firmware in my microcontrollers using a file .bat provided by Texas Instruments. 

我的应用程序运行成功,但是,我遇到路径文件夹问题。 

My application ran with success, however, I`m with path folder problem. 

我当前的代码如下:

           处理MSP =新处理();

            MSP.StartInfo.WorkingDirectory = @" D:\Projects\Test_Fixture\Test_Fixture_Visual_Studio\uniflash_windows_64&quot ;;

            MSP.StartInfo.FileName =" dslite.bat";

            MSP.Start();

            Thread.Sleep(500);

            MSP.WaitForExit();

            Process MSP = new Process();
            MSP.StartInfo.WorkingDirectory = @"D:\Projects\Test_Fixture\Test_Fixture_Visual_Studio\uniflash_windows_64";
            MSP.StartInfo.FileName = "dslite.bat";
            MSP.Start();
            Thread.Sleep(500);
            MSP.WaitForExit();

在MSP.StartInfo.WorkingDirectory中我需要包含".bat"的精确路径。文件。 

In MSP.StartInfo.WorkingDirectory I need to include the precise path for the ".bat" files. 

如何在C#中编码,我的软件在我的应用程序的同一文件夹中看起来是自动的?

How Can I code in C#, in the way that my software will look automatic inside of the same folder of my application?

感谢您的关注和最好的问候。 

Thank you for your attention and best regards. 

试试这个。

MSP.StartInfo.WorkingDirectory = System.IO.Directory.GetCurrentDirectory();