A powerful, headless automation engine for Windows that monitors folders and automatically converts documents to PDF. Designed as a robust "set-and-forget" background service, hardened to work reliably with cloud-synced folders like OneDrive.
Academic Project: Developed as a Major Project for the B.Tech (AI & MI) program at the University of Jammu.
- Automatic Conversion – Monitors a designated folder and converts new
.docxfiles to.pdfautomatically - Cloud-Sync Resilient – Built to handle file locks from services like OneDrive using intelligent retry mechanisms
- Fully Configurable – All paths and settings managed through a simple
config.jsonfile - Silent Background Operation – Runs invisibly using Windows Task Scheduler, starting automatically at login
- Robust & Stable – Processes files serially with file-locking to prevent duplicate processing
- Easy Installation – Automated setup via
install.ps1script
Before installing FileFlow, ensure you have:
- Windows 10/11
- PowerShell 5.1+ (pre-installed on Windows)
- LibreOffice – Download here
- Default installation path:
C:\Program Files\LibreOffice
- Default installation path:
Clone or download this repository to your computer:
git clone https://github.com/Dupahar/PowerShell-File-Converter.git
cd PowerShell-File-ConverterOr download and extract the ZIP to a location like:
C:\Users\YourUser\Downloads\fileflow
Open config.json in a text editor and update the paths to match your system:
{
"watchFolder": "C:\\Users\\YourUser\\OneDrive\\Documents\\WatchFolder",
"logFile": "C:\\Users\\YourUser\\Downloads\\fileflow\\engine\\FileFlow.log",
"libreOfficePath": "C:\\Program Files\\LibreOffice\\program\\soffice.exe",
"maxRetries": 5,
"retryDelaySec": 5,
"scanIntervalSec": 15
}Configuration Options:
watchFolder– Directory to monitor for new.docxfileslogFile– Path where conversion logs will be savedlibreOfficePath– Path to LibreOffice executablemaxRetries– Number of conversion retry attemptsretryDelaySec– Seconds to wait between retriesscanIntervalSec– Folder scan frequency in seconds
Important: The installer must be run with Administrator privileges.
- Right-click PowerShell or Windows Terminal and select Run as Administrator
- Navigate to the project directory:
cd C:\Users\YourUser\Downloads\fileflow
- Run the installer:
.\install.ps1
You should see a success message confirming the background task was created.
Once installed, FileFlow runs automatically in the background.
- First Time: Log out and log back in to trigger the background task
- Subsequent Runs: FileFlow starts automatically at each login
- Save or move any
.docxfile into your configuredwatchFolder - FileFlow scans every 15 seconds (configurable)
- After conversion, both the PDF and original
.docxwill be moved to aprocessedsubfolder
View the log file specified in config.json (default: engine\FileFlow.log) to check:
- Conversion status
- Error messages
- Processing history
FileFlow uses a polling-based system for maximum reliability:
- Monitoring – The
Start-FileFlow.ps1script runs in a loop, scanning thewatchFolderperiodically - File Locking – Detected files are "locked" to prevent duplicate processing
- Cloud-Sync Handling – Implements retry logic to handle OneDrive/cloud service file locks
- Conversion – Uses LibreOffice in headless mode to convert documents to PDF
- Organization – Moves processed files to a
processedsubfolder
This architecture ensures that even with synchronization delays, files are eventually processed correctly.
fileflow/
├── engine/
│ ├── Start-FileFlow.ps1 # Main monitoring script
│ └── FileFlow.log # Activity log (created at runtime)
├── config.json # Configuration file
├── install.ps1 # Installation script
└── README.md # This file
-
Check that the background task is running:
- Open Task Scheduler
- Look for "FileFlow Background Service"
- Verify it's enabled and running
-
Review the log file for errors
-
Ensure LibreOffice is installed at the specified path
-
Verify the
watchFolderpath is correct and accessible
- Ensure files are
.docxformat - Check that LibreOffice path in
config.jsonis correct - Look for lock file issues in the logs
- Try manually running:
.\engine\Start-FileFlow.ps1
- Open Task Scheduler as Administrator
- Find and delete "FileFlow Background Service"
- Delete the project folder
This project is part of academic coursework for B.Tech (AI & MI) at the University of Jammu.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
Note: This is an academic project and may require additional hardening for production use.