Share via


IWbemBackupRestoreEx::Backup method

The IWbemBackupRestoreEx::Backup method backs up the contents of the static repository to a separate file.

Syntax

HRESULT Backup(
  [in] LPCWSTR strBackupToFile,
  [in] long    lFlags
);

Parameters

  • strBackupToFile [in]
    Constant, null-terminated string of 16-bit Unicode characters that contains the file name to backup the contents of the repository.

  • lFlags [in]
    Reserved. This parameter must be 0 (zero).

Return value

This method returns an HRESULT indicating the status of the method call. The following list lists the value contained withinan HRESULT.

  • WBEM_E_INVALID_PARAMETER
    One of the arguments is not valid.

  • WBEM_E_ACCESS_DENIED
    User does not have the right to perform this. For more information, see Maintaining WMI Security.

  • S_OK
    Method succeeded.

Remarks

The Backup method locks out write operations during method processing. This operation may also block out read operations, although they are queued up until the operation is complete.

Examples

The following C++ example shows how to correctly call the IWbemBackupRestoreEx::Backup method.

// The pInt variable is of type IWbemBackupRestoreEx*
pInt->Backup(L"c:\\\\winnt\\system32\\wbem\\repository\\back.x", 0);

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Wbemcli.h (include Wbemidl.h)

Library

Wbemuuid.lib

DLL

Wbemsvc.dll