Can you automate changing default application for a file type?

Page 2 of 2 FirstFirst 12

  1. Posts : 275
    Windows 10
    Thread Starter
       #11

    dalchina said:
    What's your Windows build? (Win key + r, winver). (Sadly still not a forum requirement).


    Try restarting... and if it changes, try disabling fast startup if enabled and repeat the process.
    Build is 17134.706. I tried rebooting but the setting didn't change.
      My Computer


  2. Posts : 42,955
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #12

    Current build 1803. Interesting it's not consistent. I suggest there's a trigger there somewhere that's causing it to flip.. see if you can identify it. Make sure you have a pdf file icon visible as much as possible, and try to note when it changes indicating the association has changed.
      My Computers


  3. Posts : 275
    Windows 10
    Thread Starter
       #13

    dalchina said:
    Current build 1803. Interesting it's not consistent. I suggest there's a trigger there somewhere that's causing it to flip.. see if you can identify it. Make sure you have a pdf file icon visible as much as possible, and try to note when it changes indicating the association has changed.
    I'll keep an eye out, but if the trigger isn't on either of the obvious occasions — system startup and starting the app — then it may be very difficult to spot. This brings me back to my original question: As a workaround, could I write a shell script to change the default handler for pdf and run that on a schedule?
      My Computer


  4. Posts : 42,955
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #14

    If you look here:
    Restore Default File Type Associations in Windows 10 | Tutorials
    and find the pdf link - a reg file-

    That is written to reset the default to Edge.

    You could look at your registry, modify the above..

    Or perhaps simply create a reg file from the relevant key and apply that at a time of your choosing.

    Experiment carefully.
      My Computers


  5. Posts : 275
    Windows 10
    Thread Starter
       #15

    After doing a bit or research, it seems that I ought to be able to do something using the assoc and ftype commands in a cmd shell, but I can't seem to get them to work.
      My Computer


  6. Posts : 1
    Windows 10 x64
       #16

    Hello ricecrispies, I'm having the exact same problem with Windows 7 and Sumatra PDF (it changes the default from Sumatra PDF to WPS), so I don't think the version of Windows has anything to do with this problem. I'm also sick of WPS putting up ads in the bottom right of my screen. Excellent program, however it also has some painful features. Might be another lot of Chinese spyware like suggested with their drones
      My Computer


  7. Posts : 1
    Windows 10
       #17

    I'm here because I also have the problem of WPS resetting my PDF default from Adobe to WPS.
    The PDF box is also unchecked in the WPS Configuration Tools box, yet it keeps resetting, requiring me to go back and open the file with "Choose another app" and then checking the box to make Adobe Acrobat Reader the default.
      My Computer


  8. Posts : 1,223
    W10-Pro 22H2
       #18

    A few tests reveal that all is not what it seems! My default pdf reader is Sumatra, and that is what is shown in Registry Editor under .pdf, but that is not necessarily the program that will run. I found no association with the .pdf extension using ASSOC under an admin prompt, but could I set one - but that did not seem to change the program that ran when I either dbl-clicked on a pdf in Explorer, or typed the name at the command prompt. Nor did it alter the registry setting.

    I could change the association using 'open with' under explorer, and this did change the default (and the icon), but had no effect on either the registry entry or the ASSOC result. Nor did editing the registry.

    So it seems (in my case, at least: W10 1903) that neither a command-line ASSOC change nor a registry change (via merge or direct edit) will do the job.
      My Computer


  9. Posts : 42,955
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #19

    I think you will find the key to this is Userchoice in the registry.

    Here are two pairs of keys representing a change of association from Chrome to Sumatra:
    HKU\S-1-5-21-xxxxxxx-1002\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\UserChoice\Hash: "WLrIq1DOV64="
    HKU\S-1-5-21-xxxxxxx-1002\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\UserChoice\Hash: "MFG97o0WrjA="

    HKU\S-1-5-21-xxxxxx-1002\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\UserChoice\ProgId: "ChromeHTML"
    HKU\S-1-5-21-xxxxxx-1002\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\UserChoice\ProgId: "SumatraPDF"

    I have WPS installed on my other PC (but am thinking of uninstalling it) and never had a problem with the pdf association changing.

    Many people who have problems with their pdf association seem to be using Adobe products.

    Given the keys above, you could possibly write a continuous looping script that rewrites the registry key, but this is much more of a fudge and far from ideal.

    ----------------------
    If you want to know WHEN the change is made, you could monitor the key and generate an alert using e.g.
    Registry Live Watch will track changes in Windows Registry live

    Can you automate changing default application for a file type?-1.jpg
    Note I see this when I launch the current WPS (it is updated automatically so should be the latest version) - i.e. I've not set WPS Writer as default.
    Last edited by dalchina; 28 Aug 2019 at 15:09.
      My Computers


  10. Posts : 42,955
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #20

    I came across this:
    https://answers.microsoft.com/en-us/...1-828caf3de17e

    - WPS updates relatively often- could your change of default be related?
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 00:47.
Find Us




Windows 10 Forums