Running a batch file with parameters in Python OR F#

前端 未结 3 1978
旧巷少年郎
旧巷少年郎 2021-01-13 18:38

I searched the site, but I didn\'t see anything quite matching what I was looking for. I created a stand-alone application that uses a web service I created. To run the clie

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-13 19:33

    In F#, you could use the Process class from the System.Diagnostics namespace. The simplest way to run the command should be this:

    open System.Diagnostics
    Process.Start("run-client.bat", "param1 param2")
    

    However, if you need to provide more parameters, you may need to create ProcessStartInfo object first (it allows you to specify more options).

提交回复
热议问题