2

I'm trying to programmatically open .jpg file in Windows Server 2008 R2.

var fileName = @"C:\Users\Admin\Desktop\TEST.JPG";
Process.Start(fileName);

But this code causes an error, because Photo Gallery Viewer component is not installed in the system.

enter image description here

But if I open the file by double click from explorer, it opens in MS Paint. In the register there is only one verb "printto". How Windows open file in MS Paint? What verb used by default in double click action?

enter image description here

Gepard_vvk
  • 79
  • 4

1 Answers1

0

I dont have Windows Server 2008 R2, but afaik Windows Shell uses Perceived Type mechanism. So If Shell dont know, how open JPEG file type, looks HKEY_CLASSES_ROOT\SystemFileAssociations\image\OpenWithList key and hooray - mspaint.exe.

Xearinox
  • 3,224
  • 2
  • 24
  • 38