About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
The archive attribute is a flag on every Windows file. A file-copy backup sets its idea of "changed since last backup" on that flag: the flag is set on files that have changed, and a backup tool clears it after copying the file. That works if exactly one tool owns the flag. If a second tool, script or person clears it, the backup skips files that changed. If nothing clears it, the job copies everything every night and "incremental" is only a label.
This question matters for simple script-based backups on file servers, and for older products that still use the flag. It also helps when you are deciding whether a provider's "incremental" is based on flags, timestamps or something better.
What is the archive attribute, in Microsoft's words?
Microsoft's file attribute reference defines FILE_ATTRIBUTE_ARCHIVE (value 32, hexadecimal 0x20) as "a file or directory that is an archive file or directory. Applications typically use this attribute to mark files for backup or removal." The word "typically" is doing work: it is a convention between programs, not something Windows enforces on a backup.
The attrib page describes the same flag from the command line. Setting it "marks files that have changed since the last time they were backed up. The xcopy command uses archive attributes."
So the flag has no memory of who cleared it or why. It is one bit per file.
How do the Windows copy tools use it?
Two of Microsoft's own tools show the two behaviours that real backup types need.
| Tool and switch | Copies | Resets the flag on the source? | Behaves like |
|---|---|---|---|
xcopy /a |
Files with the flag set | No ("doesn't modify the archive file attribute of the source file") | Differential: everything since the last full |
xcopy /m |
Files with the flag set | Yes ("turns off archive file attributes in the files that are specified in the source") | Incremental: everything since the last backup of any kind |
robocopy /a |
Files with the flag set | No | Differential |
robocopy /m |
Files with the flag set | Yes | Incremental |
The distinction is the same one the Volume Shadow Copy Service (VSS) draws for applications. In its definition of backup types, an incremental backup saves "files created or changed since the last full or incremental backup" and marks them as backed up. A differential saves files changed "since the last full backup" and does not mark them. A copy backup is made "regardless of the state of each file's backup history" and does not update that history.
Microsoft's VSS page speaks of "backup history" and does not say that history is the archive attribute on every file type, so do not assume it for a particular product. Ask the vendor.
Why does a backup miss changed files?
The flag fails in the missing direction when something other than the backup clears it. The routes are these:
- A second tool uses
/m. Anyone who copies the same share withrobocopy /morxcopy /mfor a one-off task clears the flag on every file they copy. The nightly job then sees those files as already backed up. - Two backup products share one volume. Each clears the flag when it finishes. The one that runs second sees nothing to do.
- A script clears flags by mistake.
attrib -aclears the flag. Theattribpage shows-aapplied to a wildcard group of files, and/sextends anyattribcommand to subdirectories. A tidy-up script that clears flags across a tree removes every pending change. - Deletions are invisible. A flag lives on a file. A file that no longer exists has no flag, so a flag-driven incremental cannot tell the backup that a file was deleted or renamed. Microsoft does not state this directly; it follows from how the flag works. A restore from the chain can therefore bring back files that users deleted.
Example (illustrative): fs01 is backed up nightly at 22:00 by a script on backup01 that runs robocopy D:\Shares \\backup01\nightly /s /m. By 12:00 on Tuesday, 300 files have changed; each has the archive attribute set. At 12:00 an administrator copies the share to a USB disk with xcopy D:\Shares E:\spare /s /m for a colleague, so xcopy copies the 300 flagged files and clears the flag on them. At 22:00 the nightly job sees no flagged files from Tuesday and copies none of them. If the USB disk is lost, those 300 files exist in no backup. At an average of 4 MiB each, 300 × 4 MiB = 1,200 MiB of work is unprotected, and no job reported an error.
Why does a backup copy every file every night?
The flag fails in the other direction when nothing clears it, or when something sets it again.
- The tool does not clear it.
xcopy /aandrobocopy /aleave the flag on purpose. Used nightly with no periodic full that clears the flag, they copy everything flagged, which grows toward the entire share. That is differential behaviour working as designed, not a fault. - The destination is treated as a source. Microsoft states that "the xcopy command creates files with the archive attribute set, whether or not this attribute was set in the source file." If a second job then backs up that destination with the flag, every file looks new each time.
- Something rewrites files every night. If a program rewrites a file, the file counts as changed even when the contents are the same. A tool that rewrites every file nightly makes every file "changed".
- Backup run as a copy. A
copytype backup (VSS_BT_COPY, orwbadmin start backupwith parameters, which Microsoft says "creates a Volume Shadow Copy Service (VSS) copy backup and won't update the history of the files") leaves history untouched on purpose. Choosing it for the nightly job means a later incremental sees all changes since the last full again.
What should you decide?
| If you need | Use flags? | Reason |
|---|---|---|
| A small share, one script, one owner of the flag | Possibly | Cheap and simple if nothing else touches the flag |
| Several tools, admins or products on the same files | No | Any of them can clear or set the flag |
| To know about deleted or renamed files | No | The flag cannot represent them |
| A restore that matches a point in time | A method with a catalogue | A flag history has no point in time of its own |
A timestamp or journal method has its own weak points, explained in the question on block-level and file-level incremental backups. The point here is narrower: the archive flag is shared state, and shared state breaks when two parties write it.
How can you check this on your own system?
Start with commands that only read.
- List what a flag-based job would copy, without copying.
robocopyhas/l: "files are to be listed only (and not copied, deleted, or time stamped)". Combine it with/a, which does not reset the flag:robocopy D:\Shares C:\scratch /s /a /l. TheC:\scratchpath is a placeholder; because/lcopies nothing, no files are written there. The listing is what a flag-based incremental would pick up now. - Do the same with xcopy. Microsoft documents
xcopy /las generating "a list of files that are to be copied, but doesn't actively copy the files". Use/a, not/m, so the listing does not reset flags. - Read the attributes.
attribwith a path displays attributes; add/sto include subdirectories. Look for the archive attribute on files that should have been backed up already. - Ask the product. Find out whether its incremental method reads the archive attribute, and what it does when a second tool is also running. If it uses VSS backup types, ask which one the schedule requests.
Disruptive step: attrib +a and attrib -a change the flag on every file they match. Setting it (+a) makes the next flag-driven job copy everything. Clearing it (-a) hides every pending change from the next job. Both are reversible only by running the opposite command, which loses the real state of which files had changed. Do not run either on a production share unless the next backup is meant to be a full one. Never use /m for "just looking".
Read next
Related articles you may want next.
- Backup & RecoveryWindows Server Backup and wbadmin: the limits to know before you rely on themUnderstand Windows Server Backup retention, VSS modes, system-state exclusions and bare-metal recovery limits before relying on a backup.Read article
- Backup & RecoveryWhat a Windows file copy can miss: alternate data streams, links, placeholders and long pathsHow alternate data streams, reparse points, hard links, cloud placeholders and long paths affect Windows file-level backup and restore.Read article
- Backup & RecoveryThe files Windows leaves out of a backup on purpose: FilesNotToBackup and FilesNotToSnapshotWhat the FilesNotToBackup and FilesNotToSnapshot registry keys exclude from Windows backups, which tools honour them, and how to audit them.Read article
Risks and limits
- These commands have not been run or lab-tested. They are taken from Microsoft's documentation.
- Microsoft's pages describe the behaviour of
attrib,xcopyandrobocopy. They do not describe how any third-party backup product uses the archive attribute. - The Windows Server Backup and VSS pages say "backup history". They do not say whether that history is stored in the archive attribute, a catalogue or something else.
- Deleted-file blindness and "any write sets the flag" follow from the flag being a per-file attribute. Microsoft does not state these directly.
- Whether a given write, rename or move sets the flag is not stated on these pages. Test it on a scratch folder before relying on it, and for streams, links and placeholders see "What a Windows file copy can miss: alternate data streams, links, placeholders and long paths".
Sources
- attrib — Microsoft Learn, updated 2023-09-25, accessed 17 November 2026
- xcopy — Microsoft Learn, updated 2024-05-28, accessed 17 November 2026
- robocopy — Microsoft Learn, updated 2025-03-17, accessed 17 November 2026
- File Attribute Constants — Microsoft Learn, updated 2025-09-23, accessed 17 November 2026
- VSS_BACKUP_TYPE enumeration — Microsoft Learn, updated 2022-01-31, accessed 17 November 2026
- wbadmin start backup — Microsoft Learn, updated 2023-02-03, accessed 17 November 2026
This article was originally published on .