1 out of 1 rated this helpful - Rate this topic

pragma autorecover

Applies to: desktop apps only

The pragma autorecover preprocessor command adds a MOF file to the list of files compiled during repository recovery. The list of autorecover MOF files is stored in this registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WBEM\CIMOM\autorecover mofs

WMI checks the integrity of the WMI repository when the operating system starts WMI. If the repository is damaged, WMI automatically rebuilds the repository and recompiles any MOF files listed in this key in the registry.

The following describes the syntax for the pragma autorecover command:


#pragma autorecover

However, you must observe the following restrictions when using this command:

  • WMI cannot recover MOF files located on a remote computer.

    Therefore, the MOF files listed in this registry key must reside on the local computer.

  • You cannot specify the command-line switches that the MOF compiler uses when WMI recovers a MOF file.

    Therefore, you should include pragma commands in your MOF file that make command-line switches unnecessary. The following example describes a common command-line switch that WMI does not use when recovering a MOF file from this registry key: mofcomp -N:Root\Test mymof.mof

    However, you can specify the namespace using a pragma command in the MOF file.

    
    #pragma namespace ("\\\\.\\Root\\test")
    
    

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

See also

Preprocessor Commands

 

 

Send comments about this topic to Microsoft

Build date: 3/9/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ