Calling Batch File From C#

后端 未结 2 1022
被撕碎了的回忆
被撕碎了的回忆 2021-02-20 10:36

I am hoping that this is an easy question, but i have the following code in my C# application and for some reason it will not execute the batch file I am pointing to.

         


        
2条回答
  •  猫巷女王i
    2021-02-20 11:16

    Try setting the proc.StartInfo.UseShellExecute to true; this tells the OS to perform a lookup of the file extension to find the correct handler in the registry.

提交回复
热议问题