A modern WPF application for managing Dokan file system mirrors with an intuitive user interface π
Features β’ Installation β’ Usage β’ Building
- ποΈ Multiple Mount Management - Create and manage multiple mirror mounts simultaneously
- πΎ Smart Drive Letter Selection - Automatically assigns available drive letters, prevents conflicts
- π€ Auto-Mount on Startup - Configure mounts to automatically mount when the application starts
- π Read-Only Mode - Mount mirrors in read-only mode for data protection (enabled by default)
- π Environment Variable Support - Use environment variables in paths (e.g.,
%USERPROFILE%\Desktop) - π― System Tray Support - Minimize to system tray with notification support
- β‘ Single Instance - Only one application instance runs at a time; launching again restores the window
- π Auto-Unmount - Automatically unmount drives on application exit with confirmation
- πΎ Persistent Configuration - Save and restore mount configurations between sessions
- π·οΈ Dynamic Volume Labels - Automatically sets volume labels based on source (drive label or folder name)
- π¨ Modern UI - Built with MahApps.Metro for a clean, modern interface
- π Non-Blocking Operations - Async mount/unmount operations keep UI responsive
- β±οΈ Smart Unmount - Progress tracking with timeout handling and background completion
- π IPC API - Query mount points from external applications via WM_COPYDATA and Named Pipes
- πͺ Windows 10/11 (x64)
- π· .NET 8.0 Runtime - Download
- π¦ Dokan Driver - User mode file system library for Windows
- π Administrator privileges - Required for mount operations
- Download the latest release from the Releases page
- Install Dokan Driver if not already installed
- Extract the downloaded archive
- Run
dokan-mirror-manager.exeas Administrator
β οΈ Important: The application must be run with Administrator privileges to perform mount operations.
- Click the Add button
- Select a source directory or drive using the folder browser
- A drive letter is automatically assigned from available letters
- Optionally enable Auto Mount to automatically mount on application startup
- Read Only mode is enabled by default for safety
- Click the Mount π button to mount the drive
- Mount: Click the folder open icon (π) next to the mount item
- Unmount: Click the folder remove icon (ποΈ) next to the mounted item
- Shows elapsed time during unmount: "Unmounting Z:... (5s)"
- If unmount takes longer than expected (>10s), displays timeout dialog with options
- Can continue in background if needed
- Select an unmounted item from the list
- Click the Remove button
π‘ Tip: You cannot remove a mounted drive. Unmount it first.
- Minimize: Close the window to minimize to system tray (shows notification)
- Restore: Click the tray icon or launch the application again
- Exit: Right-click tray icon β Exit (prompts to unmount drives)
The application runs as a single instance. If you try to launch it while already running:
- If visible: Nothing happens (already running)
- If in tray: Window automatically restores and comes to front
- π§ Visual Studio 2022 or later (or VS Code with C# extension)
- π· .NET 8.0 SDK - Download
- π¦ Dokan Driver (for testing) - Download
# Clone the repository
git clone https://github.com/player-alex/dokan-mirror-manager.git
cd dokan-mirror-manager
# Restore dependencies
dotnet restore
# Build the project (Release configuration)
dotnet build -c Release
# Or build for x64 specifically
dotnet build -c Release --arch x64# Run as Administrator (required for Dokan operations)
dotnet run --project dokan-mirror-manager/dokan-mirror-manager.csproj
β οΈ Note: Must be run as Administrator for Dokan operations.
Mount configurations are automatically saved to mounts.json in the application directory.
Configuration includes:
- π Source paths (supports environment variables)
- πΎ Destination drive letters
- π€ Auto-mount settings
- π Read-only settings
The configuration file is created automatically on first mount and updated whenever changes are made.
You can use Windows environment variables in source paths within mounts.json:
[
{
"SourcePath": "%USERPROFILE%\\Desktop",
"DestinationLetter": "Z:\\",
"AutoMount": true,
"IsReadOnly": true
}
]Supported variables:
%USERPROFILE%- User's home directory%APPDATA%- Application data folder%LOCALAPPDATA%- Local application data folder%ProgramFiles%- Program Files directory%TEMP%- Temporary files directory- Any other Windows environment variables
The application automatically manages drive letters to prevent conflicts:
- Auto-Assignment: Automatically assigns available drive letters when adding new mounts
- Conflict Resolution: If a drive letter is already in use, automatically selects the next available one
- Duplicate Handling: When loading from
mounts.json, duplicates are automatically resolved - Dynamic Updates: Drive letter dropdowns update in real-time based on availability
Dokan Mirror Manager provides an IPC (Inter-Process Communication) API that allows external applications to query mount point information.
The API uses Windows messages (WM_COPYDATA) and Named Pipes for communication:
- Client finds the application window by title:
"Dokan Mirror Manager" - Client sends
WM_COPYDATAmessage with a unique pipe name - Server responds via the specified Named Pipe with JSON data
Message: WM_COPYDATA (0x004A)
dwData:0x8002(WM_GET_MOUNT_POINTS)lpData: UTF-16LE encoded pipe name (with null terminator)cbData: Byte length of pipe name (including null terminator)
Response Format (JSON):
{
"success": true,
"mountPoints": [
{
"srcPath": "C:\\SourceFolder",
"dstPath": "Z:\\",
"driveName": "SourceFolder",
"status": "Mounted",
"isReadOnly": true,
"autoMount": false,
"errorMessage": ""
}
],
"timestamp": "2025-10-26T18:00:00.000Z",
"version": "1.0"
}See Examples/MountPointQuery/Python/mount_point_query_client.py for a complete implementation:
import win32gui
from ctypes import *
# Find application window
hwnd = win32gui.FindWindow(None, "Dokan Mirror Manager")
# Create Named Pipe name
pipe_name = f"DokanMirrorManager_Query_{uuid.uuid4().hex}"
# Send WM_COPYDATA request
# ... (see example file for complete code)
# Receive response via Named Pipe
# Response contains JSON with mount point informationSee Examples/MountPointQuery/CSharp/TestSendCopyData/Program.cs for a complete C# implementation.
| Status | Description |
|---|---|
Unmounted |
Not currently mounted |
Mounting |
Mount operation in progress |
Mounted |
Successfully mounted |
Unmounting |
Unmount operation in progress |
Error |
Mount operation failed |
- UIPI (User Interface Privilege Isolation): The application uses
ChangeWindowMessageFilterExto allowWM_COPYDATAmessages from processes with different privilege levels - Named Pipes: Each request uses a unique pipe name to prevent conflicts
- Timeout: The server has a 10-second timeout for pipe connections
| Technology | Purpose | Version |
|---|---|---|
| .NET | Application framework | 8.0 |
| WPF | UI framework | - |
| Caliburn.Micro | MVVM framework | 5.0.258 |
| MahApps.Metro | Modern UI toolkit | 2.4.11 |
| DokanNet | .NET wrapper for Dokan | 2.3.0.1 |
| Hardcodet.NotifyIcon.Wpf | System tray support | 2.0.1 |
β Application crashes on mount
- β Ensure Dokan Driver is properly installed
- β Run the application as Administrator
- β
Check
mount_error.login the application directory for details - β Verify the source path exists and is accessible
πΎ Drive letter not available
- β Make sure the drive letter is not already in use
- β Check Windows Disk Management for assigned letters
- β Try a different drive letter
π« Application won't start
- β Verify .NET 8.0 Runtime is installed
- β
Check
crash.login the application directory - β Ensure you're running as Administrator
- β Try running from command line to see error messages
β οΈ Already running message appears
This is normal behavior. The application uses single-instance mode:
- If the window is hidden in tray, it will be restored automatically
- If the window is already visible, the existing instance continues running
β±οΈ Unmount is taking a long time
If unmount takes longer than expected:
- β Close any programs accessing files on the drive (Explorer, cmd, etc.)
- β Wait for the timeout dialog to show processes using the drive
- β Choose to continue waiting or let it complete in background
- β The drive will unmount automatically when all file handles are released
This project is licensed under the MIT License - see the LICENSE file for details.
- Dokan Project - User mode file system library for Windows
- Application icon created by Muhamad Ulum - Flaticon
