sqmRobocopyGui is a PowerShell module with a WinForms GUI for robocopy. Pick source and target with the Explorer folder dialog or drag them in, tick the options you need, each with its help text, and the finished command line appears immediately, validated live against the mistakes that make robocopy fail or delete more than intended. Then run it right there: dry run with /L first, live log, progress and the exit code in plain words. Or take it away as a batch file, a PowerShell script or a scheduled task. No dependencies beyond robocopy itself.
robocopy is the tool for large copies, mirrors and file server migrations, and it has close to a hundred switches with their own syntax. The classic failures are small: "D:\Target\" in quotes, where the backslash escapes the quote and robocopy reports an invalid parameter; /MIR pointed at the wrong folder; no /R, so a single locked file is retried a million times, 30 seconds apart. sqmRobocopyGui catches those while you click.
| By hand | With sqmRobocopyGui |
|---|---|
| Paths typed or pasted, quotes and trailing backslashes by trial and error | Explorer folder dialog, history, drag and drop; directories always written without a trailing backslash |
robocopy /? in a second window to look up /DCOPY, /XJD or /MAXLAD | Every option in its category with short help in the row and the full text below |
/MIR on the wrong target, noticed when the files are gone | Destructive options in orange, a hint in the list, and a confirmation that says what will be deleted |
| Batch file that reports exit code 1 as an error | Batch and PowerShell output with exit code handling: 0 to 7 success, 8 and above error |
| Scheduled task clicked together in the Task Scheduler UI | Ready Register-ScheduledTask script, or created directly after a confirmation |
| PowerShell | Windows PowerShell 5.1 or PowerShell 7 on Windows (the GUI is WinForms), both verified |
| Modules | None. robocopy.exe is part of every Windows version |
| robocopy | Options as of Windows 11 24H2 and Windows Server 2025. Newer switches such as /COMPRESS, /SPARSE or /IoRate are not available on older Windows versions |
| Rights | Normal user rights for normal copies. /B, /ZB, /COPYALL and owner or auditing information need an elevated GUI, which the title bar shows |
| Language | The user interface and the handbook are German |
Show-sqmRobocopyGui uses the Visual Studio dark theme of the other powershelldba.de tools. Only options you actually set end up in the command; everything else stays at robocopy's default.
/COPY and attribute flags, optional values for /MT, file and folder pickers for /XF, /XD and the log file. Mutually exclusive options deselect each other.
/E /MT:16: the live log lists every file robocopy would copy, the result line explains the exit code.Picking a preset sets its options and keeps source and target. The file mask is only replaced when the preset brings its own (the SQL backup one). Presets that delete data (mirror, move, server migration) trigger the usual confirmation before a real run.
| Preset | Options | What it does |
|---|---|---|
| Copy folder (with subfolders) | /E /DCOPY:DAT /MT /R:3 /W:5 | The everyday case. Copies everything including empty subfolders, keeps folder timestamps, uses several threads, retries 3 times at 5 second intervals. Deletes nothing in the target. |
| Mirror /MIR (target = image of source) | /MIR /DCOPY:DAT /MT /R:3 /W:5 /XJ | Makes the target an exact image of the source. Deletes everything in the target that is missing in the source. Skips junction points to avoid loops. |
| Add new files only (overwrite nothing) | /E /XO /XC /XN /R:3 /W:5 | Copies only files that do not exist in the target yet. Older, changed and newer files in the target are left alone. |
| Move (files and folders) | /MOVE /E /R:3 /W:5 | Copies, then deletes in the source: files and folders. |
| Server migration with ACLs (admin) | /MIR /COPYALL /DCOPY:DAT /ZB /MT:32 /XJ /R:1 /W:1 /NP | For migrations. Also copies NTFS permissions, owner and auditing, and uses backup mode to read files you have no access to (needs admin rights). 32 threads, one retry, no percent output in the log. Mirrors, so it deletes in the target. |
| NAS / Linux share | /E /FFT /DST /Z /XJ /R:3 /W:10 | For targets with coarse timestamps. /FFT allows 2 seconds of tolerance, /DST compensates the daylight saving shift, /Z makes copies restartable. |
| Large files (VHDX, ISO, backups) | /E /J /R:3 /W:10 | /J copies unbuffered, which spares memory and is faster for very large files. |
| Distribute SQL backups (*.bak, *.trn) | *.bak *.trn /S /J /XO /R:3 /W:10 | Copies only backup files, walks subfolders but skips empty ones, skips files that are newer in the target, unbuffered for large files. |
| Slow WAN link | /E /Z /COMPRESS /MT:4 /R:10 /W:30 | Restartable, compresses on the wire (/COMPRESS, needs SMB compression), few threads, generous retries: 10 attempts at 30 second intervals. |
| Folder structure only (no files) | /E /XF * /R:1 /W:1 | Creates the folder tree in the target but copies no file, because every file is excluded with /XF *. |
| Dry run: list only | /E /L /R:1 /W:1 | /L only lists what would be copied and changes nothing. Good for checking another setup first. |
Errors mean robocopy would refuse the call or the combination contradicts itself. Hints flag what is allowed but risky. Double-click on a line jumps to the option. Before a real run the GUI also checks that the source is reachable and the target drive or share exists.
| Area | Examples |
|---|---|
| Paths | Source or target missing, source equals target, wildcards in a directory, source inside the target with /MIR or /PURGE, target inside the source |
| Exclusive groups | /S /E /MIR, /Z /B /ZB, /COPY /SEC /COPYALL /NOCOPY, /MOV /MOVE, the four log variants |
| Values | /MT 1 to 128, /MAX and /MIN in bytes only, /MIN above /MAX, dates for /MAXAGE, /RH time window, allowed letters for /COPY and attribute flags |
| Combinations | /MT with /IPG or /EFSRAW, /TEE without a log file, /XX without /MIR, log file without /NP |
| Risk | /MIR, /PURGE, /MOV, /MOVE delete data, /MIR on a drive or share root, /MON and /MOT never end, /REG changes the defaults, no /R, options that need admin rights |
robocopy D:\Daten\Projekte "\\nas01\backup\Projekte" /MIR /MT:16 /DCOPY:DAT /XF *.tmp Thumbs.db /XD ~snapshot /R:3 /W:5 /LOG:"C:\Logs\projekte.log" /NP
| Format | Use |
|---|---|
| Command line | One line, quotes only where needed, directories without a trailing backslash |
| Batch (.cmd) | chcp 65001 for umlauts in paths, % escaped as %%, exit code 0 to 7 returns 0, 8 and above returns the robocopy error |
| PowerShell | Argument array, & robocopy.exe @robocopyArgs, throws from exit code 8 |
| Scheduled task | Register-ScheduledTask script: once, daily, weekly or interval, as SYSTEM or the current user, catches up missed runs, no parallel instance. Stops with a message if the task exists |
robocopy runs in the background; the window stays responsive and shows the output as it arrives.
/L: robocopy lists what it would copy, delete or skip, and changes nothing./MIR, /PURGE, /MOV or /MOVE it names the folder in which files will be deleted, and "No" is the default button.*EXTRA files that a mirror deletes in orange, errors in red. Progress bar and name of the current file, cancel button./TEE for this run, so the output still appears in the window.| Function | Purpose |
|---|---|
| Show-sqmRobocopyGui | The WinForms GUI, optionally prefilled with -Source, -Destination or an existing -CommandLine |
| New-sqmRobocopyCommand | Command line, batch, PowerShell, scheduled task script or raw argument list from a hashtable |
| Test-sqmRobocopyParameter | Offline rule check, optionally with -CheckPath, returns errors and warnings per option |
| ConvertFrom-sqmRobocopyCommand | Existing command line (cmd, batch, PowerShell) or .RCJ job file back into a hashtable |
| ConvertFrom-sqmRobocopyExitCode | The exit code bit mask as success flag and text |
# From the PowerShell Gallery Install-Module sqmRobocopyGui -Scope CurrentUser # Or from the repository - always for all users (asks for UAC), adds a Start menu entry Install.cmd # GUI (or double-click Start-sqmRobocopyGui.cmd without installing) Show-sqmRobocopyGui -Source D:\Daten -Destination \\nas01\backup\Daten # Mirror as a nightly scheduled task $p = @{ Source = 'D:\Daten'; Destination = '\\nas01\backup\Daten'; MIR = $true; MT = 16; R = 3; W = 5; LOG = 'C:\Logs\daten.log'; NP = $true } Test-sqmRobocopyParameter -Parameter $p -CheckPath New-sqmRobocopyCommand -Parameter $p -Format ScheduledTask -ScheduleType Daily -ScheduleTime 22:00
The last sources and targets are remembered in %APPDATA%\sqmRobocopyGui\config.json. Tests\Test-sqmRobocopyGui.ps1 lets robocopy parse every option itself, runs all output formats against a folder with spaces, an umlaut and % in its name, and drives the GUI including dry run, real run and cancel.
No dependencies to install (also on the PowerShell Gallery): unzip, double-click Start-sqmRobocopyGui.cmd, drag two folders in.
PowerShell source, MIT-licensed. Clone or download the ZIP and run Install.cmd.
GUI walkthrough, input types, presets, every validation rule, output formats, running, scripting. Markdown source also on GitHub.
The same idea for Ola Hallengren's DatabaseBackup: all 75 parameters, validated, as T-SQL or Agent job.
The official documentation of every switch, exit code and remark.
Get in touch about the module, a feature, or the wider powershelldba.de toolchain.