I downloaded the Reg to MOF tool and compiled some of our custom Registry Keys which worked fine. There was particular Key that didn't work and after some testing and messing around I realized why it isn't working:
The key I am using is: HKLM\Software\MyCompanyWindows
Because the key has the name Windows in it, it fails to import. I get the generic check the formatting for your MOF file error.
The MOF file you tried to import could not be compiled. Ensure that the MOF file contains valid data. You can use the command line mofcomp utility to test the data.
But if I run a MOFCOMP against the MOF I am trying to import it checks the syntax successfully.
If I change the key to MyCompanyWin or MyCompanyW it imports with no problem.
We have rolled out this key to almost every device in our organization and connected it to other inventory agents so there is no possibility of changing the key.
Is there any way to disable the validation check that SCCM is performing?