Skip to content

Feature: Robocopy Multithreaded support - #18742

Open
DarkEden-coding wants to merge 19 commits into
files-community:mainfrom
DarkEden-coding:Robocopy-Support
Open

Feature: Robocopy Multithreaded support#18742
DarkEden-coding wants to merge 19 commits into
files-community:mainfrom
DarkEden-coding:Robocopy-Support

Conversation

@DarkEden-coding

Copy link
Copy Markdown

This PR implements support for Robocopy multithreading in file operations. It should be able to robustly handle a variety of situations, such as copy‑pasting, moving, and file deletion as well. During testing for large numbers of small files, this can increase transfer rate by up to ten times. In general, this has been a requested feature for a while and will increase parity with the Windows File Explorer.

This is my first pr so sorry if I messed anything up!

Basic code changes

File Change Methodology
IDevToolsSettingsService.cs Added UseRobocopyForFileOperations and RobocopyThreads Exposes Robocopy preferences on the existing Dev Tools settings contract
DevToolsSettingsService.cs Persists those settings, defaulting to disabled and 8 threads Stores them with the other Dev Tools JSON settings
DevToolsViewModel.cs Binds the toggle and thread count to the service Provides the MVVM surface for the Dev Tools page
DevToolsPage.xaml Adds a Robocopy expander and thread-count NumberBox Adds experimental settings UI under Dev Tools
Resources.resw Adds Robocopy label and description strings Provides localized UI text
ShellFilesystemOperations.cs Routes large copy, move, and delete operations to Robocopy when enabled Uses Shell operations for small operations and renames, and Robocopy for bulk operations when safe
FileOperationsHelpers.cs Adds a Robocopy process runner, batching, progress reporting, and delete-via-/MIR Calls robocopy.exe with /MT, verifies results, and supports cancellation through a CancellationTokenSource
FilesystemHelpers.cs Awaits batched Jump List folder removal after delete and move operations Avoids bursts of COM updates after bulk operations
IWindowsJumpListService.cs Adds RemoveFoldersAsync Provides a batch API for multi-folder removal
WindowsJumpListService.cs Uses a single Jump List load/save operation for multiple paths Deduplicates removals; RemoveFolderAsync delegates to the batch method
StatusCenterItem.cs Retains only the first source and destination path Reduces memory retained by large completed operations
CopyEngineResult.cs Maps COPYENGINE_E_USER_CANCELLED to Generic Treats cancellation as a known status rather than an unknown HRESULT

Resolved / Related Issues

To prevent extra work, all changes to the Files codebase must link to an approved issue marked as Ready to build. Please insert the issue number following the hashtag with the issue number that this Pull Request resolves.

Steps used to test these changes

Stability is a top priority for Files and all changes are required to go through testing before being merged into the repo. Please include a list of steps that you used to test this PR.

  1. Opened Files
  2. Created 2 folders with random content (10 gb of random sized files)
  3. Tested by repeatedly copying these files back and forth using cut, paste, regular copy and paste, and trash as well as permanent deletion.
  4. Also tested for between-drive copy and pastes.

Required testing:

  1. Copying between a local drive and a cloud drive.
  2. In general, more variety in the amount of items transferred and different locations transferred to.

@CLAassistant

CLAassistant commented Jul 19, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@TechyAditya

This comment was marked as resolved.

@Josh65-2201

Copy link
Copy Markdown
Member

Your beach is quite old to build, could you rebase it with main.

@DarkEden-coding

Copy link
Copy Markdown
Author

@Josh65-2201 its updated, seems to be working the same with a basic test

@Josh65-2201

Josh65-2201 commented Jul 21, 2026

Copy link
Copy Markdown
Member

What is considered large for testing, the amount of files or size? Below is what i can think of should be tested, if you have anything else please let me know

Delete: Local to test, MTP (phone) to test, SMB network to test, Alternative data steams to test
Move: Local to test, MTP (phone) to test, SMB network to test
Copy: Local to test, MTP (phone) to test, SMB network to test
Replace: Local to test, MTP (phone) to test, SMB network to test

@TechyAditya

Copy link
Copy Markdown

Hi Josh, the number of files are considered as large for testing because bigger files have consistent speeds of transfers, and this PR has 0 advantage on few file transfers. This would shine if you try transferring something like python venv, node_modules folder of nodejs apps, etc. on a very bloated developer project, for example.

@yair100 yair100 added the ready for review Pull requests that are ready for review label Jul 26, 2026
</wctcontrols:SettingsExpander.HeaderIcon>
<ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=UseRobocopyForFileOperations}" IsOn="{x:Bind ViewModel.UseRobocopyForFileOperations, Mode=TwoWay}" />
<wctcontrols:SettingsExpander.ItemsHeader>
<Grid

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use a SettingsCard for this. See the cache thumbnails setting for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review Pull requests that are ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Please add multi-threaded copy support

5 participants