The IWbemBackupRestore::Restore method deletes the contents of the current repository and restores them with the contents of a previously specified backup.
Because Windows Management Instrumentation (WMI) is the server for this interface and must be stopped to complete this operation successfully, the COM connection is broken if this call is successful.
HRESULT Restore( LPCWSTR strRestoreFromFile, long lFlags );
Constant, null-terminated string of 16-bit Unicode characters that contains the file name of the file to be restored. The specified file should point to a file previously created with IWbemBackupRestore::Backup.
One of the following flags from the WBEM_BACKUP_RESTORE_FLAGS enumeration.
Does not shut down active clients; returns an error if there are any.
Shuts down any active clients.
This method returns an HRESULT that indicates the status of the method call. The following list lists the value contained within the HRESULT.
The default mode is the same as setting the force-mode flag, which breaks all active connections. This results in remote procedure call (RPC) errors from active COM connections to WMI—until new connections are established.
The following C++ example shows how to call the IWbemBackupRestore::Restore method.
// The pInt variable is of type IWbemBackupRestore* pInt->Restore( L"c:\\\\Windows\\System32\\wbem\\repository\\back.x", WBEM_FLAG_BACKUP_RESTORE_FORCE_SHUTDOWN );
|Minimum supported client||Windows Vista|
|Minimum supported server||Windows Server 2008|
|Header||wbemcli.h (include Wbemidl.h)|