Skip to content

Latest commit

 

History

History
77 lines (42 loc) · 2.06 KB

pragma-autorecover.md

File metadata and controls

77 lines (42 loc) · 2.06 KB
description ms.assetid ms.tgt_platform title ms.topic ms.date topic_type api_name api_type api_location
Adds a MOF file to the list of files compiled during repository recovery.
8901c04e-f8c1-45b0-b69d-e2ebc948f088
multiple
pragma autorecover
reference
05/31/2018
APIRef
kbSyntax
pragma
NA

pragma autorecover

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

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008

See also

Preprocessor Commands