Access denied
Microsoft MS-DOS
Severity: MinorWhat Does This Error Mean?
Access denied means DOS cannot modify or delete the file because it is read-only, in use, or is a directory. Use ATTRIB to check and change the file's attributes. This is not a password issue — DOS does not have file permissions like modern systems.
Affected Models
- MS-DOS 3.x
- MS-DOS 4.x
- MS-DOS 5.x
- MS-DOS 6.x
- PC-DOS
- FreeDOS
- DOSBox
Common Causes
- File has the Read-Only attribute set
- Trying to delete or overwrite a directory name instead of a file
- File is currently open by another program
- Floppy disk is write-protected
- File is a system or hidden file
How to Fix It
-
Check the file attributes with ATTRIB.
Type ATTRIB MYFILE.TXT to see its attributes. R means Read-Only. S means System. H means Hidden. A means Archive (this one does not cause Access denied).
-
Remove the Read-Only attribute.
Type ATTRIB -R MYFILE.TXT to remove read-only. Then retry your operation (DEL, COPY, etc.).
-
Check if the floppy disk is write-protected.
On 3.5-inch disks: slide the write-protect tab to cover the hole. On 5.25-inch disks: remove the write-protect sticker from the notch.
-
Make sure the file is not open by another program.
If a TSR or another program has the file open, DOS cannot modify it. Close the other program first, or reboot if necessary.
Frequently Asked Questions
Does DOS have user accounts and permissions like Windows?
No. DOS has no concept of users or file permissions. Access denied is purely about file attributes (read-only, system, hidden) — not who is logged in.
What is the ATTRIB command?
ATTRIB displays and changes file attributes. ATTRIB +R MYFILE.TXT makes it read-only. ATTRIB -R -S -H MYFILE.TXT removes read-only, system, and hidden attributes.