INFO: Recommended Methods for Compiling Managed Object Format (MOF) Files (245773)



The information in this article applies to:

  • Microsoft Windows Management Instrumentation 1.0
  • Microsoft Windows Management Instrumentation 1.1

This article was previously published under Q245773

SUMMARY

Windows Management Instrumentation (WMI) provides the following three methods for compiling Managed Object Format (MOF) files into the WMI repository:
  • Method 1: Run the Mofcomp.exe file, specifying the MOF file as the command-line parameter.
  • Method2: Use the IMofCompiler interface and the CompileFile method.
  • Method 3: Drop the MOF file into the %SystemRoot%\System32\Wbem\MOF folder.
Microsoft recommends that you use the first two methods for compiling MOF files into the repository. That is, run the Mofcomp.exe file or use the IMofCompiler::CompileFile method.

The third method is provided only for backward-compatibility with earlier versions of WMI and should not be used because this functionality may not be provided in future releases.

MORE INFORMATION

The Mofcomp.exe file provides command-line help on the usage switches for options. See the Platform SDK Documentation section "MOF Compiler" under WMI references for more details.

REFERENCES

For more information on the Managed Object Format syntax, the Mofcomp.exe file, and the IMofCompiler interface, please refer to the "Windows Management Instrumentation" section in the Platform SDK Documentation.

Modification Type:MinorLast Reviewed:3/20/2004
Keywords:kbDSWManage2003Swept kbinfo kbWBEM kbWBEM100 KB245773