ProtectVolume Method (Standard 8)

7/8/2014

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

This method enables File-Based Write Filter (FBWF) protection for a specific volume.

This topic uses Managed Object Format (MOF) syntax.

Syntax

uint32 ProtectVolume(
  [in]  string Name
);

Parameters

  • Name
    [in] The name of the volume on which to enable write filtering. The volume name can be either a drive letter or a device name.

    Examples: "C:", "\Device\Harddiskvolume1"

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 enable write protection on an FBWF-protected volume.

Windows PowerShell

$ComputerName = "localhost"   # or "remote-machine-name"
$Class = "Fbwf"
$Volume = "\Device\HarddiskVolume1"

$Fbwf = [WmiClass]"\\$ComputerName\ROOT\Microsoft\WriteFilters:$Class"

$Result = $Fbwf.ProtectVolume($Volume)

$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=@"         
strVolumeName = "D:"

On Error Resume Next

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

Err = Fbwf.ProtectVolume(strVolumeName)
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 strVolumeName, "protected"
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