RestoreFile Method (Standard 8)

7/8/2014

Review the syntax, members, and examples of the Fbwf.RestoreFile WMI method for Windows Embedded 8 Standard (Standard 8).

This method resets the cached view of the specified file for a volume protected by File-Based Write Filter (FBWF).

This topic uses Managed Object Format (MOF) syntax.

Syntax

uint32 RestoreFile(
  [in]  string Path
);

Parameters

  • Path
    [in] The full path to a cached file or directory to reread from disk. The path must be an absolute path with a drive letter, such as "C:\notes.txt" or "C:\Windows\Temp\".

Return Value

Returns an HRESULT that indicates WMI status, a WMI error, or an error from the EWF and FBWF API libraries.

Example

This example can be used to reset the cached view of a file or directory.

Windows PowerShell

$ComputerName="localhost"   # or "remote-machine-name"
$Class = "Fbwf"
$Path = "E:\Windows\Temp\TestFolder"

$Fbwf = [WmiClass]"\\$ComputerName\ROOT\Microsoft\WriteFilters:$Class"
$Result = $Fbwf.RestoreFile($Path)

$ReturnValue = "0x{0:x}" -f $Result.ReturnValue
Write-Host "Method executed with return code: " $ReturnValue

VBScript

strComputer = "localhost"   ' or "remote-machine-name"
strNamespace = "\root\Microsoft\WriteFilters"
strClass = "Fbwf=@"
strFile = "D:\Windows\Temp\Test.txt"

On Error Resume Next

Set Fbwf = GetObject("WINMGMTS:\\" & strComputer & _
   strNamespace & ":" & strClass)

Err = Fbwf.RestoreFile(strFile)
If Err.Number <> 0 Then
   WScript.Echo "Method exited with error code: 0x" & Hex(Err.Number)
   Wscript.Echo Err.Source & " - " & Err.Description
   WScript.Quit(1)
Else
   WScript.Echo strFile, "added to exclusion list"
End If

Requirements

Architecture

x64,
x86

MOF

FBWFProvider.mof

Supported Clients

Windows XP Embedded SP3
Windows Embedded Standard 2009
Windows Embedded Standard 7 SP1
Windows Embedded 8 Standard
WEPOS 1.1 SP3
POSReady 2009
Windows Embedded POSReady 7
Windows Fundamentals for Legacy PCs 7

WMI Namespace

root\Microsoft\WriteFilters

WMI Provider

FBWFProvider

See Also

Reference

Fbwf Class