0

I am trying to open or edit files with the ProcessStartInfo class. If I use .docx, .txt or similar it works. Only with .jpg and .png there are problems.

I'm using var psi = new ProcessStartInfo(someJpgOrPngFile) and in the psi.Verbs is only the printto Attribute.

I have tested the following code (https://stackoverflow.com/a/40340313) to get the available verbs and there I get open and shelledit

If I set the verb manually, like open or edit the file will be opened but this is not an option for me due to my code.

Does anyone have an idea why I get only printto as verb?

I'm using .NetFramework 4.6.1

Hadda
  • 47
  • 2
  • 12
  • you want to edit the jpg , png file? so why you need printto? – Antoine V Jul 11 '18 at 10:06
  • 1
    @ThierryV Read the question again. OP needs the open / edit verb but only get the printto verb and is asking why – Sir Rufo Jul 11 '18 at 10:08
  • @Hadda the answer to your question is inside the link you gave: *The ProcessStartInfo.Verbs property is somewhat broken as it does not consider the way how newer versions of Windows (Windows 8 and above afaik) retrieve the registered application* – Sir Rufo Jul 11 '18 at 10:13
  • @SirRufo Thanks I have probably read over. Is there possibly a workaround or a better method to call the standard program – Hadda Jul 11 '18 at 10:18
  • 1
    You know how to get all possible verbs (see your link), you know how to set a verb (see your question) - well, what is your problem? Setting a verb from one of the possibles? Just do it – Sir Rufo Jul 11 '18 at 10:20
  • The problem is, if I want to call for example an _edit_, this is not indicated with the possible verbs. – Hadda Jul 11 '18 at 10:25

0 Answers0