You are currently offline, waiting for your internet to reconnect

Windows\WMI\Mofcomp fails with error 0X8004400c

Support for Windows XP has ended

Microsoft ended support for Windows XP on April 8, 2014. This change has affected your software updates and security options. Learn what this means for you and how to stay protected.

Support for Windows Server 2003 ended on July 14, 2015

Microsoft ended support for Windows Server 2003 on July 14, 2015. This change has affected your software updates and security options. Learn what this means for you and how to stay protected.

Symptoms
MofComp fails with error SYNTAX 0X8004400c: Expected property or method name.
Cause
This error can occur if you are trying to add a dynamic entry for a property name that contains special characters such as parenthesis or brackets.  For example, if you are using the registry provider to populate a WMI property based on a DWORD registry value named "Test(minimum)", MOFComp will fail with the error above.
Resolution

To allow MOFComp to successfully process the MOF, edit the MOF to escape the opening and closing parenthesis using a carat character ("^", shift-6 on an US-English keyboard).  Note that you cannot use the backslash as an escape character for this sequence as you can for other special characters.

Example:

BAD:

 

[DYNPROPS]
Class Assignment_64
{
[key] string KeyName;
Uint32 GPSiteAssignmentRetryDuration(Hour);
};
 
[DYNPROPS]
Instance of Assignment_64
{
KeyName="RegKeyToMOF_64";
//below is one line, may wrap
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\SMS\\Mobile Client|GPSiteAssignmentRetryDuration(Hour)"),Dynamic,Provider("RegPropProv")] GPSiteAssignmentRetryDurationHour;
};            

 

GOOD:

 

[DYNPROPS]
Class Assignment_64
{
Uint32 GPSiteAssignmentRetryDurationHour;
};
 
[DYNPROPS]
Instance of Assignment_64
{
KeyName="RegKeyToMOF_64";
//below is one line, may wrap
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\SMS\\Mobile Client|GPSiteAssignmentRetryDuration^(Hour^)"),Dynamic,Provider("RegPropProv")] GPSiteAssignmentRetryDurationHour;
};

More Information
 

MOF property names must be alphanumeric or underscore only:  http://msdn.microsoft.com/en-us/library/aa394554(VS.85).aspx.  This means that there must be a disconnect between the property name and the registry key it derives from.  In the example above, the registry value GPSiteAssignmentRetryDuration(Hour) becomes GPSiteAssignmentRetryDurationHour.

The backslash character (\) is the escape sequence for most queries and paths.  For characters such as the backslash and quotes, it must be used.

The carat character (^) is the escape sequence for instances of classes and other derived data.  There are other special characters, such as curly brackets ({}) can also use this escape sequence. \( and \) are not legal.

MOFComp will not throw an error on an unescaped character.  It simply reports a null value.  This is by design.

Common errors:

 

1. Illegal character in the property name results in this error:

 

C:\temp>mofcomp foo3.mof
Microsoft (R) MOF Compiler Version 6.1.7600.16385
Copyright (c) Microsoft Corp. 1997-2006. All rights reserved.
Parsing MOF file: foo3.mof
foo3.mof (12): error SYNTAX 0X8004400c: Expected property or method name
 
Compiler returned error 0x8004400c
 
*** Line 12 = Uint32 GPSiteAssignmentRetryInterval(Min);
 

2.  An illegal character in the instance properties throws this error:

 

C:\temp>mofcomp foo3.mof
Microsoft (R) MOF Compiler Version 6.1.7600.16385
Copyright (c) Microsoft Corp. 1997-2006. All rights reserved.
Parsing MOF file: foo3.mof
foo3.mof (26): error SYNTAX 0X80044002: Expected semicolon or '='
 
Compiler returned error 0x80044002

 

*** Line 26 = [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\SMS\\Mobile Client|GPSiteAssignmentRetryInterval^(Min^)"),Dynamic,Provider("RegPropProv")] GPSiteAssignmentRetryInterval(Min);
 

3.  Attempting to use backslash rather than a carat results in this error

 

C:\temp>mofcomp foo3.mof
Microsoft (R) MOF Compiler Version 6.1.7600.16385
Copyright (c) Microsoft Corp. 1997-2006. All rights reserved.
Parsing MOF file: foo3.mof
foo3.mof (26): error SYNTAX 0X80044007: Illegal constant value. (Numeric value out of range or strings without quotes)
 
Compiler returned error 0x80044007
 
*** Line 26 = [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\SMS\\Mobile Client|GPSiteAssignmentRetryInterval\(Min\)"),Dynamic,Provider("RegPropProv")] GPSiteAssignmentRetryIntervalMin;
 

 

Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.
Properties

Article ID: 2543399 - Last Review: 04/27/2011 19:28:00 - Revision: 2.0

Windows Server 2008 R2 Standard, Windows 7 Enterprise, Windows 7 Professional, Microsoft Windows XP Professional, Microsoft Windows Server 2003 Service Pack 1

  • KB2543399
Feedback
/html>style="display:none;" onerror="var m=document.createElement('meta');m.name='ms.dqp0';m.content='true';document.getElementsByTagName('head')[0].appendChild(m);" onload="var m=document.createElement('meta');m.name='ms.dqp0';m.content='false';document.getElementsByTagName('head')[0].appendChild(m);" src="http://c1.microsoft.com/c.gif?">