Kill process started with System.Diagnostic.Process.Start(“FileName”)

后端 未结 6 1331
生来不讨喜
生来不讨喜 2021-02-05 22:48

I am trying to create an app that will perform actions on specific times (much like the Windows Task Scheduler). I am currently using Process.Start() to launch the file (or exe)

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-05 22:56

    Don't do it this way.

    It's not clear whether the intent of your program is 'Always launch with Windows Media Player' or 'Launch with the registered MP3 player', which might be, say, iTunes.

    If you need WMP, use Process.Start with the full path to windows media player.

    If you need the registed MP3 player, you can find out the correct exe using the code shown here. Again, start the process with this exe path, passing the MP3 as a parameter.

提交回复
热议问题