Skip to main content

WordPipe Batch Processing via Command Line

Automate find-and-replace operations across thousands of Word documents using WordPipe's command-line interface. Ideal for server migrations, corporate rebranding, compliance updates, and any scenario requiring bulk document modifications.

Basic Find and Replace

WordPipe performs find-and-replace operations in Word documents from the command line. Specify search text, replacement text, target folder, and file patterns.

REM Basic WordPipe find-and-replace in a single folder
WordPipe.exe /find:"Acme Corporation" /replace:"Global Industries Ltd" /folder:"C:\Documents\Contracts" /include:"*.docx"

REM Case-sensitive replacement
WordPipe.exe /find:"CONFIDENTIAL" /replace:"INTERNAL USE ONLY" /folder:"C:\Documents\Policies" /include:"*.docx" /matchcase

REM Replace in headers, footers, and body text
WordPipe.exe /find:"Draft v2.1" /replace:"Final v3.0" /folder:"C:\Documents\Reports" /include:"*.docx" /headers /footers

REM Replace hyperlinks (update old URLs to new)
WordPipe.exe /find:"http://intranet.oldcompany.com" /replace:"https://portal.newcompany.com" /folder:"C:\Documents\Templates" /include:"*.doc;*.docx" /hyperlinks

Folder Processing with Recursion

Process entire directory trees with /recurse to find and replace text across deeply nested folder structures. Combine with file include/exclude patterns for precise targeting.

REM Recurse through all subdirectories
WordPipe.exe /find:"2024 Annual Report" /replace:"2025 Annual Report" /folder:"C:\SharedDrive\Corporate" /include:"*.docx" /recurse

REM Process both .doc and .docx files recursively
WordPipe.exe /find:"[OLD LOGO]" /replace:"[NEW LOGO]" /folder:"\\FileServer\Departments" /include:"*.doc;*.docx;*.docm" /recurse

REM Exclude specific subdirectories using multiple calls
WordPipe.exe /find:"Version 4.x" /replace:"Version 5.0" /folder:"C:\Projects\Documentation" /include:"*.docx" /recurse /exclude:"*\Archive\*;*\Backup\*"

REM Process files modified in the last 30 days only
WordPipe.exe /find:"support@oldcompany.com" /replace:"help@newcompany.com" /folder:"C:\Documents" /include:"*.docx" /recurse /modified:30

Server Migration Example

A complete batch script for server migration — updating server names, UNC paths, and URLs across all Word documents in a department share. Demonstrates multiple sequential replacements with logging.

@echo off
REM Server Migration: Update all document references from old to new infrastructure
REM Run as administrator for network share access

set DOC_ROOT=\\FileServer\Departments
set LOG_FILE=C:\Logs\wordpipe_migration_%date:~-4,4%%date:~-7,2%%date:~-10,2%.log
set BACKUP_DIR=C:\Backups\PreMigration

echo [%date% %time%] Server migration started >> "%LOG_FILE%"

REM Step 1: Update server hostnames in document text
WordPipe.exe /find:"SQLSRV01" /replace:"DBCLUSTER-PROD" /folder:"%DOC_ROOT%" /include:"*.docx;*.doc" /recurse /backup:"%BACKUP_DIR%"
echo [%date% %time%] Step 1 complete: Server hostnames updated >> "%LOG_FILE%"

REM Step 2: Update UNC paths
WordPipe.exe /find:"\\FILESRV01\shared" /replace:"\\NASCLUSTER\corporate" /folder:"%DOC_ROOT%" /include:"*.docx;*.doc" /recurse
echo [%date% %time%] Step 2 complete: UNC paths updated >> "%LOG_FILE%"

REM Step 3: Update intranet URLs
WordPipe.exe /find:"http://intranet.acme.local" /replace:"https://portal.acme.com" /folder:"%DOC_ROOT%" /include:"*.docx;*.doc" /recurse /hyperlinks
echo [%date% %time%] Step 3 complete: Intranet URLs updated >> "%LOG_FILE%"

REM Step 4: Update email domain references
WordPipe.exe /find:"@acme.local" /replace:"@acme.com" /folder:"%DOC_ROOT%" /include:"*.docx;*.doc" /recurse
echo [%date% %time%] Step 4 complete: Email domains updated >> "%LOG_FILE%"

echo [%date% %time%] Migration complete. Backup at: %BACKUP_DIR% >> "%LOG_FILE%"

Backup and Safety Options

Always use backup options when performing bulk replacements on production documents. WordPipe provides built-in backup capabilities to ensure safe rollback.

REM Create backups before modifying documents
WordPipe.exe /find:"Old Company Name" /replace:"New Company Name" /folder:"C:\Documents" /include:"*.docx" /recurse /backup:"C:\Backups\%date:~-4,4%%date:~-7,2%%date:~-10,2%"

REM Dry run - report what would change without modifying files
WordPipe.exe /find:"Deprecated API" /replace:"New API" /folder:"C:\Docs" /include:"*.docx" /recurse /preview /log:"C:\Logs\preview_report.txt"

REM Process with full logging for audit trail
WordPipe.exe /find:"RESTRICTED" /replace:"PUBLIC" /folder:"C:\Legal\Contracts" /include:"*.docx" /recurse /backup:"C:\Backups\Legal" /log:"C:\Logs\legal_changes.txt" /verbose

Scheduled Execution

Schedule WordPipe batch operations to run automatically using Windows Task Scheduler. Common use cases include nightly compliance scans, weekly template updates, and periodic data standardization across document repositories.

Using schtasks.exe (Command Line)

REM Schedule weekly compliance scan - every Monday at 3:00 AM
schtasks /create /tn "DataMystic\WordPipe Compliance Scan" /tr "\"C:\Scripts\wordpipe_compliance.bat\"" /sc weekly /d MON /st 03:00 /ru SYSTEM /rl HIGHEST

REM Schedule nightly template refresh
schtasks /create /tn "DataMystic\WordPipe Template Update" /tr "\"C:\Scripts\wordpipe_templates.bat\"" /sc daily /st 01:00 /ru SYSTEM /rl HIGHEST

REM Run the task immediately (for testing)
schtasks /run /tn "DataMystic\WordPipe Compliance Scan"

Using PowerShell (Task Scheduler Cmdlets)

# Schedule WordPipe batch processing for weekly compliance document updates
# Runs every Monday at 3:00 AM with email notification on failure

$action = New-ScheduledTaskAction `
    -Execute "C:\Scripts\wordpipe_compliance.bat" `
    -WorkingDirectory "C:\Scripts"

$trigger = New-ScheduledTaskTrigger -Weekly -DaysOfWeek Monday -At "03:00"

$settings = New-ScheduledTaskSettingsSet `
    -StartWhenAvailable `
    -RestartCount 2 `
    -RestartInterval (New-TimeSpan -Minutes 10) `
    -ExecutionTimeLimit (New-TimeSpan -Hours 4) `
    -AllowStartIfOnBatteries

$principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -RunLevel Highest

Register-ScheduledTask `
    -TaskName "DataMystic\WordPipe Weekly Compliance" `
    -Action $action `
    -Trigger $trigger `
    -Settings $settings `
    -Principal $principal `
    -Description "Weekly WordPipe scan to update compliance language across all department documents"

# Verify task registration
Get-ScheduledTask -TaskName "WordPipe Weekly Compliance" -TaskPath "\DataMystic\" | Format-List

Next Steps