Brows.Win32.Interop.Operations
1.0.0
dotnet add package Brows.Win32.Interop.Operations --version 1.0.0
NuGet\Install-Package Brows.Win32.Interop.Operations -Version 1.0.0
<PackageReference Include="Brows.Win32.Interop.Operations" Version="1.0.0" />
<PackageVersion Include="Brows.Win32.Interop.Operations" Version="1.0.0" />
<PackageReference Include="Brows.Win32.Interop.Operations" />
paket add Brows.Win32.Interop.Operations --version 1.0.0
#r "nuget: Brows.Win32.Interop.Operations, 1.0.0"
#:package Brows.Win32.Interop.Operations@1.0.0
#addin nuget:?package=Brows.Win32.Interop.Operations&version=1.0.0
#tool nuget:?package=Brows.Win32.Interop.Operations&version=1.0.0
Brows.Win32.Interop.Operations
Batch file operations through the Windows Shell IFileOperation API. Queue copies, moves, creates, deletes, and renames against a directory, then execute the batch on an STA worker.
Install
dotnet add package Brows.Win32.Interop.Operations
This package depends on Brows.Win32.Interop and Brows.Operations. It targets .NET Framework 4.6.2 and 4.8, and .NET 8 and 10 on Windows. It must run on Windows.
Copy a file
using Brows.Threading;
using Brows.Win32;
using Brows.Win32.Win32FileOperations;
using System.Threading;
string sourceFilePath = @"C:\Data\report.txt";
string destinationDirectory = @"C:\Archive";
var pool = new STAThreadPool("file-operations");
try {
var batch = new Win32FileOperation(destinationDirectory, pool);
batch.CopyFiles.Add(new CopyFile { Path = sourceFilePath });
bool hadWork = await batch.Operate(progress: null, token: CancellationToken.None);
}
finally {
pool.Empty();
}
Directory is the destination for CopyFiles, MoveFiles, and CreateFiles, and the containing directory for DeleteFiles and RenameFiles. CopyFile and MoveFile use source paths; DeleteFile uses Name; RenameFile uses OldName and NewName; CreateFile uses Name and Attributes.
The Operate result is false for an empty batch and true when a nonempty batch reaches native execution; it does not report the result of each item. Errors are surfaced by the returned task. The cancellation token is checked before and during queueing and at Shell progress callbacks. Work runs on the supplied STAThreadPool, which the caller owns.
Options such as Silent, NoConfirmation, RenameOnCollision, and RecycleOnDelete control Windows Shell behavior. With the default Silent = false, Windows can show its own progress UI. To receive progress through IOperationProgress, set Silent = true and pass a progress receiver to Operate. For batches created through the Composition export, configure the Shell UI owner window with Win32InteropServicesVariable.OnGetOwnerWindow before the export creates its services. See the Composition README for setup. The callback runs on the STA worker during Operate and must not synchronously wait on a thread that could be waiting for the batch.
License
MIT.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0-windows7.0 is compatible. net9.0-windows was computed. net10.0-windows was computed. net10.0-windows7.0 is compatible. |
| .NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
-
.NETFramework 4.6.2
- Brows.Operations (>= 1.3.0)
- Brows.Win32.Interop (>= 1.0.0)
- Brows.Win32.STAThreadPool (>= 1.2.2)
- Domore.Logs (>= 10.6.4)
- Microsoft.CSharp (>= 4.7.0)
-
.NETFramework 4.8
- Brows.Operations (>= 1.3.0)
- Brows.Win32.Interop (>= 1.0.0)
- Brows.Win32.STAThreadPool (>= 1.2.2)
- Domore.Logs (>= 10.6.4)
- Microsoft.CSharp (>= 4.7.0)
-
net10.0-windows7.0
- Brows.Operations (>= 1.3.0)
- Brows.Win32.Interop (>= 1.0.0)
- Brows.Win32.STAThreadPool (>= 1.2.2)
- Domore.Logs (>= 10.6.4)
-
net8.0-windows7.0
- Brows.Operations (>= 1.3.0)
- Brows.Win32.Interop (>= 1.0.0)
- Brows.Win32.STAThreadPool (>= 1.2.2)
- Domore.Logs (>= 10.6.4)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Brows.Win32.Interop.Operations:
| Package | Downloads |
|---|---|
|
Brows.Win32.Interop.Composition
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 48 | 10/5/2026 |