How to start the program to transfer to it the path to the file that initiated the launch of the program? In a console application, this is implemented using command line arguments, and WPF how?

  • Specify, do you want your program to appear exactly in the program selection menu for opening the picture "open with .."? And to set the transfer format of the file being opened in some non-standard way? (Usually, the file being opened is transmitted by the 1m argument of the command line) - Kromster
  • @KromStern, no, in the selection menu, the program is not yet needed. Is there no command line argument in a WPF application? - Lightness
  • Make the necessary clarifications in the question. The MVVM model is not relevant. - Kromster
  • @KromStern, edited the question. - Lightness

1 answer 1

The Environment.GetCommandLineArgs() method is available from anywhere in any application.