Windows 10: How to associate Photo Viewer using ftype and assoc

Discus and support How to associate Photo Viewer using ftype and assoc in Windows 10 Software and Apps to solve the problem; Hello. I want to associate png, bmp, jpg/jpeg with Windows Photo Viewer in Windows 10 (8.1) through console and without using GUI (Settings — Apps —... Discussion in 'Windows 10 Software and Apps' started by farag, Feb 28, 2018.

  1. farag Win User

    How to associate Photo Viewer using ftype and assoc


    Hello.
    I want to associate png, bmp, jpg/jpeg with Windows Photo Viewer in Windows 10 (8.1) through console and without using GUI (Settings — Apps — Default apps — setting up Photo Viewer as a default app).
    Here is my code, but unfortunately it doesn't associate at all, but works with out any errors. Restarting Explorer or PC doesn't help.
    Code: IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\command)) { New-Item -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\command -Force } IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\DropTarget)) { New-Item -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\DropTarget -Force } IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\print\command)) { New-Item -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\print\command -Force } IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\print\DropTarget)) { New-Item -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\print\DropTarget -Force } New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open -Name MuiVerb -Type String -Value "@photoviewer.dll,-3043" -Force New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\command -Name "(Default)" -Type ExpandString -Value "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1" -Force New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\DropTarget -Name Clsid -Type String -Value "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}" -Force New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\print\command -Name "(Default)" -Type ExpandString -Value "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1" -Force New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\DropTarget -Name Clsid -Type String -Value "{60fd46de-f830-4894-a628-6fa81bc0190d}" -Force cmd.exe /c "assoc .bmp=Paint.Picture" cmd.exe /c "assoc .jpg=jpegfile" cmd.exe /c "assoc .jpeg=jpegfile" cmd.exe /c "assoc .png=pngfile" cmd.exe /c "assoc .tif=TIFImage.Document" cmd.exe /c "assoc .tiff=TIFImage.Document" cmd.exe /c 'ftype Paint.Picture=%windir%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1' cmd.exe /c 'ftype jpegfile=%windir%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1' cmd.exe /c 'ftype pngfile=%windir%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1' cmd.exe /c 'ftype TIFImage.Document=%windir%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1'[/quote] Source: https://www.reddit.com/r/sysadmin/comments/72vv31/set_windows_photo_viewer_as_default_app_on/
    Source 2: Forcing Windows to use Windows Photo Viewer | NHL Data Blog
    How to really(!) associate an file extension to new program? - DosTips.com



    :)
     
    farag, Feb 28, 2018
    #1

  2. How to create and delete a custom file association

    OH, and by the way, the "assoc" and "ftype" commands do not show all the correct file association definitions.

    Tests done on my Windows 10 laptop show that Windows seems to report the file association correctly under Settings and/or Control Panel, which is different and not the case for the "assoc" and "ftype" commands.
     
    YvesTrottier, Feb 28, 2018
    #2
  3. petrib Win User
    Nokia software acquisative habits

    By removing/changing the associations.

    If you're familiar with the Windows command line, see the FTYPE and ASSOC commands. Otherwise, fire up Windows Explorer, choose "Tools", then "Folder options...", then "File Types" and change the associations there.
     
    petrib, Feb 28, 2018
    #3
  4. dalchina New Member

    How to associate Photo Viewer using ftype and assoc

    dalchina, Feb 28, 2018
    #4
  5. farag Win User
    The main key for me is not to mark "Always use this app...". After excuting script I want to open jpg, bmp files instantly. Anyway, may be it's not possible, only through Settings.
     
    farag, Feb 28, 2018
    #5
  6. dalchina New Member
    So your question becomes
    If I merged the registry file, would the effect be immediate?
    Quite often registry changes require that explorer be restarted to be applied. I've not experienced what happens if you change associations by editing the registry though.

    I assume you are experiencing a change in association, and want this always to be photoviewer.
    If so, the question then is - what is changing your association?

    Otherwise perhaps you could state the perceived problem you're trying to solve.
     
    dalchina, Feb 28, 2018
    #6
  7. farag Win User
    So I've found the solution to associate with Windows Photo Viewer instantly without restarting PC. But you need to uninstall UWP photo app before.
    Code: Get-AppxPackage -AllUsers | Where-Object name -CNotLike *Store* | Remove-AppxPackage -ErrorAction SilentlyContinue Get-AppxProvisionedPackage -Online | Where-Object DisplayName -CNotLike *Store* | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\command)) { New-Item -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\command -Force } IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\DropTarget)) { New-Item -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\DropTarget -Force } IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\print\command)) { New-Item -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\print\command -Force } IF (!(Test-Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\print\DropTarget)) { New-Item -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\print\DropTarget -Force } New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open -Name MuiVerb -Type String -Value "@photoviewer.dll,-3043" -Force New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\command -Name "(Default)" -Type ExpandString -Value "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1" -Force New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\DropTarget -Name Clsid -Type String -Value "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}" -Force New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\print\command -Name "(Default)" -Type ExpandString -Value "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1" -Force New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\DropTarget -Name Clsid -Type String -Value "{60fd46de-f830-4894-a628-6fa81bc0190d}" -Force cmd.exe /c 'ftype Paint.Picture=%windir%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1' cmd.exe /c 'ftype jpegfile=%windir%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1' cmd.exe /c 'ftype pngfile=%windir%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1' cmd.exe /c 'ftype TIFImage.Document=%windir%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1' cmd.exe /c "assoc .bmp=Paint.Picture" cmd.exe /c "assoc .jpg=jpegfile" cmd.exe /c "assoc .jpeg=jpegfile" cmd.exe /c "assoc .png=pngfile" cmd.exe /c "assoc .tif=TIFImage.Document" cmd.exe /c "assoc .tiff=TIFImage.Document" cmd.exe /c "assoc Paint.Picture\DefaultIcon=%SystemRoot%\System32\imageres.dll,-70" cmd.exe /c "assoc jpegfile\DefaultIcon=%SystemRoot%\System32\imageres.dll,-72" cmd.exe /c "assoc pngfile\DefaultIcon=%SystemRoot%\System32\imageres.dll,-71" cmd.exe /c "assoc TIFImage.Document\DefaultIcon=%SystemRoot%\System32\imageres.dll,-122"[/quote]
     
    farag, Apr 5, 2018
    #7
Thema:

How to associate Photo Viewer using ftype and assoc

Loading...
  1. How to associate Photo Viewer using ftype and assoc - Similar Threads - associate Photo Viewer

  2. Photo Viewer

    in Windows 10 Software and Apps
    Photo Viewer: My photos are resizing automatically. I have photos saved to an external drive. When I view a single photo from the drive the photo shows at the size it was saved. However if I access the drive through explorer to view all of the photos in the file they start resizing after 2...
  3. Assoc command

    in Windows 10 Software and Apps
    Assoc command: question. does the assoc command truly work powershell/cmd? i noticed that the icon does not change in my file explorer, nor do the files open with the program specified using the assoc command. i have to manually change it. does it adjust on a restart? im not positive...
  4. Assoc command

    in Windows 10 Customization
    Assoc command: question. does the assoc command truly work powershell/cmd? i noticed that the icon does not change in my file explorer, nor do the files open with the program specified using the assoc command. i have to manually change it. does it adjust on a restart? im not positive...
  5. assoc and ftype not updating file association completely in windows 10.

    in Windows 10 Gaming
    assoc and ftype not updating file association completely in windows 10.: assoc and ftype not updating file association completely in windows 10. My security camera produces a .265 file which I find I can play using VLC --demux h265 I had previously associated the files with the windows media player which didn't work and so I updated the...
  6. assoc and ftype not updating file association completely in windows 10.

    in Windows 10 Software and Apps
    assoc and ftype not updating file association completely in windows 10.: assoc and ftype not updating file association completely in windows 10. My security camera produces a .265 file which I find I can play using VLC --demux h265 I had previously associated the files with the windows media player which didn't work and so I updated the...
  7. Photo viewer

    in Windows 10 Ask Insider
    Photo viewer: Can this piece of literal shit get any worse? Most notable issues: - Random massive memory leaks which consume your system's entire memory and grinds everything to a halt unless you realize what's going on quickly enough and force close it. - Literally can't handle opening...
  8. What to use instead of Photo viewer

    in Windows 10 Software and Apps
    What to use instead of Photo viewer: What can i use instead of use instead of Photo viewer/ i use it on w7 to go through the pictures from my cctv cams ideas anyone please? 159268
  9. What to use instead of Photo viewer

    in Windows 10 Support
    What to use instead of Photo viewer: What can i use instead of use instead of Photo viewer/ i use it on w7 to go through the pictures from my cctv cams ideas anyone please? 159268
  10. Photo viewer

    in Windows 10 Network and Sharing
    Photo viewer: Hi! This problem is listed as resolved in the forum, but the given solutions did not work for me. I have Photos the preferred MS app for this function selected as my default Photo Viewer and yet I cannot open .jpg files. Why doesn't the MS product work with Windows 10?...