I created a custom resource to set file associations and it works, sometimes.
As I’m explaining the problem here I’m realizing it is probably not a DSC, maybe not even a powershell, problem - but all the smart people are here, so can I ask it anyway, or is there a more appropriate forum I should go to?
I use my custom resource to set file association for .txt and .log to notepad++.exe
But when a user double-clicks a .txt file it won’t open, but a .log file will.
In my resource I use assoc and ftype to set the associations.
The correct filetype is set.
C:\Users\simon>assoc | grep txt
And this is associated with the right exe file:
txtfile=“C:\Program Files (x86)\Notepad++\notepad++.exe” %1 %*
But it still remains that the txt file, when double-clicked on by a user, presents a popup to ask what application is they want to use to open the file, while the log file opens.
I have used the same file, changing it’s extension through .log .txt .scp and .wtx (all the txtfile extension in my system). They all launch notepad++ except .txt