CommitFile Method (Standard 8)

7/8/2014

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

This method writes the cached file to the physical disk file for a volume protected by File-Based Write Filter (FBWF).

This topic uses Managed Object Format (MOF) syntax.

Syntax

uint32 CommitFile(
  [in]  string Path
);

Parameters

  • Path
    [in] The full path to a cached file or directory to write to 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 write a cached file or directory to an FBWF-protected volume.

Windows PowerShell

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

$Fbwf = [WmiClass]"\\$ComputerName\ROOT\Microsoft\WriteFilters:$Class"
$Result = $Fbwf.CommitFile($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 = "C:\Windows\Temp\Test.txt"

On Error Resume Next

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

Err = Fbwf.CommitFile(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, "committed"
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