Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I get Windows Photo Viewer to run in Safe Mode? I'm running Microsoft Windows 7.

Screenshot

share|improve this question
    
Can't you just navigate to the photo viewer application file and run it? –  YiweiG Jul 29 '13 at 19:48
    
Ahh okay. Sorry I didn't know that. Can you use any other photo viewer? Or do you have to use the windows one? –  YiweiG Jul 30 '13 at 1:54
    
Thanks gronostaj! –  Mark Rowe Jul 30 '13 at 10:04
add comment

1 Answer

Quick analysis

During its startup phase, Windows Photo Viewer uses the GetSystemMetrics API function to check whether the system was started in safe mode. If that's the case, it will display the following message:

Windows Photo Viewer does not work in safe mode. If you want to view pictures or videos, restart your computer normally.

The actual code is located inside the PhotoViewer.dll library file, which can be usually found in these folders:

  • Windows Vista

    C:\Program Files\Windows Photo Gallery
    
  • Windows 7 and later

    C:\Program Files\Windows Photo Viewer
    

Further reading


Workaround

Use Paint or a third-party image viewer such as IrfanView, XnView, or FastStone Image Viewer.


Patching the limitation

The library file can be patched in order to fool the viewer into thinking the operating system wasn't started in safe mode. Despite what the warning message says, all features except printing appear to be working fine.

Note While the patch might have some side effects, it doesn't seem the case according to my tests.

  1. Open the program folder, which is usually located here:

     C:\Program Files\Windows Photo Viewer
    
  2. Copy the PhotoViewer.dll file to the desktop, and rename it to PhotoViewer2.dll.

  3. Open PhotoViewer2.dll file using a hex editor (e.g. HxD).

  4. Go to the proper hexadecimal offset. See below.

  5. Change the first two bytes there to 3BC0, and save the changes.

  6. Copy the saved file to the program folder.

  7. Open an elevated command prompt, type or paste the following command, and press Enter:

    cd /d "%programfiles%\Windows Photo Viewer"
    
  8. Replace the original library with the patched one by running these commands:

    taskkill /im explorer.exe /f
    takeown /f PhotoViewer.dll /a
    icacls PhotoViewer.dll /grant:r *S-1-5-32-544:F
    ren PhotoViewer.dll PhotoViewer.dll.old
    ren PhotoViewer2.dll PhotoViewer.dll
    start explorer
    

Offsets

  • Windows Vista SP2 x86 (32-bit)

    0x19741
    
  • Windows Vista SP2 x64 (64-bit)

    0x252F8
    
  • Windows 7 SP1 x86 (32-bit)

    0x9DFF
    
  • Windows 7 SP1 x64 (64-bit)

    0x689E6
    
  • Windows 8 x86 (32-bit)

    0x711DE
    
  • Windows 8 x64 (64-bit)

    0x8E785
    
  • Windows 8.1 x86 (32-bit)

    0x70CF9
    
  • Windows 8.1 x64 (64-bit)

     0x8E3F9
    

Screenshots

Before

Screenshot 1

After

Screenshot 2

Click for larger view.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.