18

When I run the following code below in a command prompt (as administrator):

"C:\Program Files\Windows Photo Viewer\PhotoViewer.dll" "C:\00012.tif"

it produces error as shown below :

"This file does not have a program associated with it for performing this action. Please install a program or, if one is already installed, create an associated in the Default Programs control panel."

Both .tif and .tiff are associated in the Default programs control panel.

I am trying to call this from a .net windows app.

Any help is appreciated.

phoenix
  • 3,069
  • 3
  • 22
  • 29
jinsungy
  • 10,717
  • 24
  • 71
  • 79

4 Answers4

37

Windows 7

rundll32 "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen path_to_image
  • path_to_image must not be quoted!
user362515
  • 897
  • 1
  • 10
  • 17
13

It's not necessary to run PhotoViewer directly, let explorer do the work for you. As a bonus, it works with relative paths as far as I can tell.

C:\Users\alphaniner> explorer Documents\test.png
alphaniner
  • 143
  • 1
  • 7
13

rundll32 "C:\Program Files\Windows Photo Viewer\PhotoViewer.dll" "C:\00012.tif"

For running a dll, there is rundll32.

SliverNinja - MSFT
  • 31,051
  • 11
  • 110
  • 173
RobinJ
  • 5,022
  • 7
  • 32
  • 61
0

By definition this answers the ops question but it may not be what he wants.

"C:\Windows\system32\mspaint.exe" "C:\somepic.png"
Jeff Luyet
  • 424
  • 3
  • 10