Automation & DevOps

    Automate Folder Verification on Windows with the FolderManifest CLI

    Your most important folders should check themselves. Here's how to schedule nightly integrity verification with the FolderManifest CLI on Windows Task Scheduler — and get alerted the moment a file changes.

    Published June 24, 202612 min read
    Mehrab Ali

    Author

    Mehrab Ali

    Data Scientist, Researcher & Entrepreneur

    Founder of ARCED Foundation, ARCED International, and Solutions of Things Lab (SoTLab). Built FolderManifest to help teams protect file integrity and stay audit-ready.

    Last updated June 28, 2026

    Quick answer

    To automate folder verification on Windows, generate a SHA-256 baseline once with foldermanifest generate --format json, then schedule foldermanifest verify with Windows Task Scheduler and branch on the exit code: 0 means unchanged, 1 means a file drifted. The CLI runs headless and ships inside the Windows app with the trial and every license.

    • Generate a JSON baseline once, then verify against it on a schedule.
    • verify exits 1 on drift — your script alerts only when something actually changed.
    • Task Scheduler runs it without anyone logged in.
    • verify is read-only — safe to run unattended every night.

    Why automate verification?

    A folder you check by hand is a folder you check until you forget. Silent corruption, an over-eager sync client, a ransomware process, or a well-meaning colleague who "tidied up" — the damage usually happens between the times a human remembers to look. Automated verification closes that gap: the folder checks itself every night and only interrupts you when something is actually wrong.

    The FolderManifest CLI is built for exactly this. generate and verify are scriptable, the exit codes are stable, and each command runs as a short-lived headless process — so it slots into Windows Task Scheduler without the app window open. The result is a simple, durable safety net: a nightly job that turns "I hope those files are fine" into "I would have been told if they weren't."

    Step 1: Generate a baseline

    Capture a SHA-256 baseline of the folder as JSON (the machine format verify reads). Do this once, when you know the folder is in a good state.

    Command Prompt
    foldermanifest generate "C:\Backups\Invoices" --format json --out invoices-baseline

    That writes invoices-baseline.json. Store it somewhere the folder's own contents can't quietly overwrite it — ideally a separate drive or directory — so a baseline tampered alongside the data can't pass verification. Treat the baseline like a known-good fingerprint of the folder at a moment you trust.

    Step 2: Write a verify script

    The script runs verify and reacts to the exit code: 0 means unchanged, 1 means drift. Here it is as a Windows batch file that emails on drift (swap in your own alerting):

    verify-invoices.bat
    @echo off
    foldermanifest verify "C:\Backups\Invoices" --manifest "D:\baselines\invoices-baseline.json" --quiet
    if %ERRORLEVEL%==0 (
      echo OK: invoices unchanged
    ) else if %ERRORLEVEL%==1 (
      echo DRIFT: invoices changed - sending alert
      powershell -Command "Send-MailMessage -To 'oncall@example.com' -From 'alerts@example.com' -Subject 'Invoice folder changed' -SmtpServer 'smtp.example.com'"
    ) else (
      echo CLI error or no license - exit %ERRORLEVEL%
    )

    The final else is the part most scripts forget: a lapsed trial or a usage error must not look like "all clear." Handling every non-zero, non-1 code as a failure is what keeps the schedule honest.

    What the exit codes mean

    Every FolderManifest command returns a stable exit code, so a scheduled task can act on the result without parsing any output. These four codes are the whole contract:

    Exit codeMeaningWhat your script should do
    0Folder matches the manifestStay silent — a clean night
    1Drift: a file was added, removed, or modifiedAlert someone
    2No active license; files untouchedTreat as failure, renew
    3Usage error (bad arguments or path)Treat as failure, fix the job

    Step 3: Schedule it with Windows Task Scheduler

    Register the batch file to run every night at 02:00. The fastest path is one line from an elevated Command Prompt:

    Command Prompt (elevated)
    schtasks /Create ^
      /TN "FolderManifest Verify Invoices" ^
      /TR "C:\scripts\verify-invoices.bat" ^
      /SC DAILY /ST 02:00 /RL HIGHEST /F

    Prefer the GUI? Open Task Scheduler → Create Task, add a Daily trigger at your chosen time, and set the action to start C:\scripts\verify-invoices.bat. Then run it once to confirm it works end to end:

    Command Prompt
    schtasks /Run /TN "FolderManifest Verify Invoices"

    Check the result with schtasks /Query /TN "FolderManifest Verify Invoices" /V /FO LIST, which prints the last run time and last result code.

    Run it unattended (no one logged in)

    For a server or a workstation that isn't always signed in, configure the task to run whether or not the user is logged on. In the GUI that's the "Run whether user is logged on or not" radio button on the General tab; from the command line, supply the run-as account:

    Command Prompt (elevated)
    schtasks /Create ^
      /TN "FolderManifest Verify Invoices" ^
      /TR "C:\scripts\verify-invoices.bat" ^
      /SC DAILY /ST 02:00 /RL HIGHEST /F ^
      /RU "DOMAIN\svc-foldermanifest" /RP *

    Two requirements make unattended runs reliable: the run-as account must have read access to the folder and its baseline, and the machine must hold an active FolderManifest trial or license. The verify command needs no interactive desktop, so headless and service contexts are fully supported.

    Step 4: Scale with a reproducible --config

    One folder is rarely the whole story. Instead of a script per folder, list every job in a JSON config and run them with a single command. The exit code is the worst result among the jobs, so the schedule still reduces to "did anything fail?"

    nightly.json
    {
      "jobs": [
        { "cmd": "verify", "paths": ["C:\\Backups\\Invoices"], "manifest": "D:\\baselines\\invoices-baseline.json" },
        { "cmd": "verify", "paths": ["C:\\Backups\\Contracts"], "manifest": "D:\\baselines\\contracts-baseline.json" },
        { "cmd": "generate", "paths": ["C:\\Backups\\Daily"], "format": "json", "out": "D:\\baselines\\daily" }
      ]
    }
    Command Prompt
    foldermanifest --config nightly.json

    Point a single Task Scheduler job at this command and you've automated the whole routine. Commit nightly.json to your ops repo and it becomes version-controlled and reviewable — see the reproducible --config guide for the full pattern. New folder to watch? Add three lines, not a new scheduled task.

    Logging & history

    For an audit trail, append each run's outcome to a dated log and keep the HTML reports. A small change to the batch file captures both:

    verify-invoices.bat (with logging)
    @echo off
    set STAMP=%date:~-4%-%date:~4,2%-%date:~7,2%
    foldermanifest verify "C:\Backups\Invoices" ^
      --manifest "D:\baselines\invoices-baseline.json" ^
      --report "D:\reports\invoices-%STAMP%" >> "D:\logs\invoices-verify.log" 2>&1
    echo %STAMP% exit=%ERRORLEVEL% >> "D:\logs\invoices-verify.log"

    Task Scheduler's History tab records every launch and its result code independently, so even without custom logging you have a built-in record of when the job ran and whether it passed. For a primer on how the underlying hashes work, see verifying folder integrity with CRC32 & SHA-256.

    Put your folders on autopilot

    The CLI is included with the 7-day trial and every lifetime license — install once on Windows and script away.

    Frequently asked questions

    How do I automate folder verification on Windows?
    Generate a SHA-256 baseline once with foldermanifest generate, then register foldermanifest verify as a Windows Task Scheduler job. The task runs on a schedule and your script branches on the exit code: 0 means unchanged, 1 means a file drifted.
    Can FolderManifest run on a schedule without the app window open?
    Yes. Each CLI command starts a short-lived headless process, does the work, and exits. It runs fine from Windows Task Scheduler whether or not the desktop window is open. You only need an active trial or license on the machine.
    Does scheduled verification need me to be logged in?
    No. In Task Scheduler choose "Run whether user is logged on or not" and supply an account that can read the folder. The verify command needs no interactive desktop, so it works on servers and unattended workstations.
    How does a scheduled job know if files changed?
    The verify command exits 0 when the folder matches its manifest and 1 when anything was added, removed, or modified. Your scheduled script branches on that exit code, for example emailing an alert only when the code is 1.
    Where do I see the result of a scheduled verification?
    Redirect the command output to a log file in your batch script, or pass --report to write a timestamped HTML report. Task Scheduler also records the last run result and exit code under the task History tab.
    Does verifying a folder modify any files?
    No. verify is strictly read-only. It hashes the current files and compares them to the manifest. It never writes, moves, or deletes anything in the folder being checked, which makes it safe to run unattended every night.
    What hash does FolderManifest use for verification?
    Verification uses SHA-256 by default, a cryptographic hash where any change to a file, even a single byte, produces a different digest. CRC32 is also available for faster, non-cryptographic change detection when speed matters more than tamper resistance.
    Do I need a JSON or Markdown manifest for scheduled verification?
    Use JSON or HTML as the verify input. Markdown manifests are branded and git-friendly but read-only, so verify rejects them. Generate a JSON baseline once, then verify against it on every run.
    What happens if my trial expires while a scheduled task is running?
    The command stops with exit code 2 and does not modify any files. Because your script treats a non-zero, non-1 code as an error rather than "all clear," an expired trial surfaces as a failure instead of a silent pass.
    How often should I regenerate the baseline manifest?
    Regenerate only when the folder legitimately changes, for example after a planned update. Between those points the baseline should stay fixed so verification can detect unexpected drift. Store the baseline somewhere the folder cannot overwrite.
    Can one scheduled task verify several folders at once?
    Yes. List each folder as a job in a JSON --config file and run them with a single command. The batch returns the worst exit code among the jobs, so the schedule still reduces to one pass-or-fail signal.
    Is the CLI a separate purchase?
    No. The CLI ships inside the FolderManifest desktop app and is included with the trial and every paid license. It is not published to npm or winget. Install the Windows app and run foldermanifest from any terminal.

    Related: Verify folder integrity with CRC32 & SHA-256 · Reproducible batch jobs with --config · CI/CD checksum validation