asked on
ASKER
ASKER
ASKER
ASKER
Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language built on the .NET Framework. PowerShell provides full access to the Component Object Model (COM) and Windows Management Instrumentation (WMI), enabling administrators to perform administrative tasks on both local and remote Windows systems as well as WS-Management and Common Information Model (CIM) enabling management of remote Linux systems and network devices.
TRUSTED BY
1. You export your file associations (dism /online /export-defaultappassociations:c:\defaultappassociations.xml)
2. Modify it and add your entry for .log; your cmtrace.exe needs to have a file type already registered. By default, .log is associated as a txtfile. (Look in the registry under HKCR\txtfile and you'll see how it is configured.
3. Save your file, and reimport it (dism /online /import-defaultappassociations:c:\defaultappassociations.xml)
4. Then the worst part - move the XML file to a share, and use your group policy under Computer Configuration\Administrative Templates\File Explorer\Set a default associations configuration file. I have tried to do this locally with no real luck.
This only works for new profiles. Existing profiles will not be overridden.
The other option is to use a login script with the SetUserFTA utility from this site: https://kolbi.cz/blog/2017/10/25/setuserfta-userchoice-hash-defeated-set-file-type-associations-per-user/
With that utility, you can associate it, and not have to worry about it.
It used to be much easier, but MS really made it a p.i.t.a. with Windows 10. They added a hashing routine in the user's key, so that anything not in the default file associations gets saved with a hash value, and if you try to change it without the matching hash, it will revert it automatically. (It was partly because 3rd party programs were over-writing FTA's without the user's consent. This is supposed to prevent this hijacking, but it made administration a nightmare.)
Coralon