botmac
botmac

Reputation: 39

Check Status of the File Based Write Filter with a Batch-File via a numeric value

I enable, disable and check the status of the FBWF with help of batch-files. That works fine. The return value of fbwfmgr /displayconfig is a text message, that tells me the status of the FBWF in the current and the next session (after reboot).

What I want to do is calling a batch-file after reboot, that shows wheter the FBWF was beeing enabled correctly (and is working now) or not.

I think it is possible to compare the text message but I want it cleaner (if possible): Is there a int-value to check?

The target OS is Windows Embedded Standard 7.

Thanks for help!


This is the message from fbwfmgr /displayconfig:

File-based write filter configuration for the current session:
    filter state: enabled.
    overlay cache data compression state: disabled.
    overlay cache threshold: 2,00 GB.
    overlay cache pre-allocation: disabled.
    size display: actual mode.
    protected volume list:
      \Device\HarddiskVolume5 (C:)
    write through list of each protected volume:
      \Device\HarddiskVolume5:
        \Regfdata
        \Zelaris

File-based write filter configuration for the next session:
    filter state: enabled.
    overlay cache data compression state: disabled.
    overlay cache threshold: 2,00 GB.
    overlay cache pre-allocation: disabled.
    size display: actual mode.
    protected volume list:
      \Device\HarddiskVolume5 (C:)
    write through list of each protected volume:
      \Device\HarddiskVolume5:
        \Zelaris

Drücken Sie eine beliebige Taste . . .

Upvotes: 1

Views: 4154

Answers (1)

botmac
botmac

Reputation: 39

I have fixed it!


@echo off & setlocal

SETLOCAL ENABLEDELAYEDEXPANSION

SET /a var=0

FOR /f "tokens=3" %%A IN ('fbwfmgr /displayconfig') do ( if "%%A"=="enabled." SET /a var = !var! + 1)

echo ####################### FILE BASED WRITE FILTER #######################

IF NOT "%var%"=="2" GOTO QUIT

COLOR A0

echo.

echo File Based Write Filter is enabled!

echo.

pause

EXIT

:QUIT

COLOR C0

echo.

echo File Based Write Filter ist disabled!.

echo.

pause

EXIT


Thanks for help.

Upvotes: 1

Related Questions