ERROR_TRANSACTION_REQUIRED_PROMOTION (0X00001AB5) Fix
This error shows when a file operation needs a transaction but one isn't set up. The fix is to move the file outside the transaction scope.
Yeah, this one's a pain
You're trying to move or copy a file and Windows throws ERROR_TRANSACTION_REQUIRED_PROMOTION (0X00001AB5). The message says something about a transaction being needed, but nothing on screen tells you where that transaction even came from. Let's fix it fast.
Step 1: Move the file outside the transaction
What's actually happening here is your application opened the file inside a Kernel Transaction Manager (KTM) context. Maybe it's a database write, a backup tool, or something using transactions. When you then try to do a MoveFile, Windows sees the file is already part of a transaction and says nope — you need to promote that transaction first (hence the name).
The quickest fix is to copy the file to a temporary location outside the transaction, then move it. Here's how in code:
// C# example — copy out of transaction first
using (TransactionScope scope = new TransactionScope())
{
// Your original code that fails
// File.Move(source, dest); // This throws 0x00001AB5
// Fix: copy to temp, then move outside
string temp = Path.GetTempFileName();
File.Copy(source, temp, true);
File.Delete(source);
File.Move(temp, dest);
scope.Complete();
}
Step 2: Use the transacted version of the API
If you must keep the transaction (for atomicity), call MoveFileTransacted instead of MoveFile. This tells Windows: "Hey, I know this file is in a transaction — handle it properly."
// Win32 API — the real fix
BOOL success = MoveFileTransacted(
L"C:\source.txt",
L"C:\dest.txt",
NULL, // no progress routine
NULL, // no context
MOVEFILE_REPLACE_EXISTING,
hTransaction // your KTM handle
);
The reason step 2 works is that MoveFileTransacted does a promotion on the transaction internally — it switches from a simple file lock to a full transactional file operation. Without that, Windows just refuses the operation because a plain move can't guarantee atomic rollback.
Less common variations
Variation A: Backup software conflict
If you're not writing code but just copying files in Explorer and getting 0X00001AB5, check if you have backup software like Acronis True Image or Veeam running. Some backup tools lock files inside transactions. The fix here is to pause the backup, do your move, then resume.
Variation B: SQL Server file operations
When moving SQL Server database files inside a SQL transaction, you'll see this error if you use xp_cmdshell or sp_configure to move files. Instead, use ALTER DATABASE ... MODIFY FILE — that does the promotion automatically.
How to prevent this from happening again
- Know when you're in a transaction. Check your code — any
TransactionScopeorBeginTransactioncall means you can't use simple file APIs. Use theTransactedversions. - For backup tools: Schedule file moves outside backup windows.
- For SQL Server: Never move files manually when a database is online. Use T-SQL commands instead.
- Test on a VM first. Recreate the scenario with a test file inside a transaction. If you get the error, you know the fix works.
Bottom line: This error is Windows being strict about transaction boundaries. Once you see it, you know a file operation crossed a line it shouldn't have. Copying outside that line or using the right API fixes it every time.
Was this solution helpful?