Windows File I/O Error Codes Reference
Quick Reference for Most Common Windows File I/O Errors
These are the most common file I/O error codes:
- 2: File not found
- 3: Path not found
- 5: Access denied
- 32: File locked/sharing violation
- 39/111: Disk full
- 110: Filename too long
- 120: Invalid filename characters
These cover about 90% of file I/O errors in typical applications.
Common File Access Errors (0-31)
Code | Constant | Description | Common Causes |
---|---|---|---|
0 | ERROR_SUCCESS | The operation completed successfully | No error |
1 | ERROR_INVALID_FUNCTION | Incorrect function | Invalid file operation |
2 | ERROR_FILE_NOT_FOUND | The system cannot find the file specified | File doesn't exist |
3 | ERROR_PATH_NOT_FOUND | The system cannot find the path specified | Directory doesn't exist |
4 | ERROR_TOO_MANY_OPEN_FILES | Too many open files | System file handle limit reached |
5 | ERROR_ACCESS_DENIED | Access is denied | Insufficient permissions, file is read-only |
6 | ERROR_INVALID_HANDLE | The handle is invalid | File handle corrupted or closed |
8 | ERROR_NOT_ENOUGH_MEMORY | Not enough storage is available | Insufficient memory |
9 | ERROR_INVALID_BLOCK | The storage control block address is invalid | Memory corruption |
10 | ERROR_BAD_ENVIRONMENT | The environment is incorrect | Invalid environment variables |
11 | ERROR_BAD_FORMAT | An attempt was made to load a malformed program | Invalid executable format |
12 | ERROR_INVALID_ACCESS | The access code is invalid | Invalid file access mode |
13 | ERROR_INVALID_DATA | The data is invalid | Corrupted file data |
14 | ERROR_OUTOFMEMORY | Not enough storage is available | Out of memory |
15 | ERROR_INVALID_DRIVE | The system cannot find the drive specified | Drive doesn't exist |
16 | ERROR_CURRENT_DIRECTORY | The directory cannot be removed | Cannot remove current directory |
17 | ERROR_NOT_SAME_DEVICE | The system cannot move the file to a different disk drive | Cross-device move attempt |
18 | ERROR_NO_MORE_FILES | There are no more files | End of directory listing |
19 | ERROR_WRITE_PROTECT | The media is write protected | Disk/file is write-protected |
20 | ERROR_BAD_UNIT | The system cannot find the device specified | Invalid device |
21 | ERROR_NOT_READY | The device is not ready | Drive not ready |
22 | ERROR_BAD_COMMAND | The device does not recognize the command | Invalid device command |
23 | ERROR_CRC | Data error (cyclic redundancy check) | Data corruption detected |
24 | ERROR_BAD_LENGTH | The program issued a command but the command length is incorrect | Invalid command length |
25 | ERROR_SEEK | The drive cannot locate a specific area or track on the disk | Disk seek error |
26 | ERROR_NOT_DOS_DISK | The specified disk or diskette cannot be accessed | Invalid disk format |
27 | ERROR_SECTOR_NOT_FOUND | The drive cannot find the sector requested | Bad disk sector |
28 | ERROR_OUT_OF_PAPER | The printer is out of paper | Printer error |
29 | ERROR_WRITE_FAULT | The system cannot write to the specified device | Write operation failed |
30 | ERROR_READ_FAULT | The system cannot read from the specified device | Read operation failed |
31 | ERROR_GEN_FAILURE | A device attached to the system is not functioning | General device failure |
File Sharing and Locking Errors (32-89)
Code | Constant | Description | Common Causes |
---|---|---|---|
32 | ERROR_SHARING_VIOLATION | The process cannot access the file because it is being used by another process | File locked by another application |
33 | ERROR_LOCK_VIOLATION | The process cannot access the file because another process has locked a portion of the file | File region locked |
34 | ERROR_WRONG_DISK | The wrong diskette is in the drive | Incorrect removable media |
36 | ERROR_SHARING_BUFFER_EXCEEDED | Too many files opened for sharing | Sharing buffer full |
38 | ERROR_HANDLE_EOF | Reached the end of the file | End of file reached |
39 | ERROR_HANDLE_DISK_FULL | The disk is full | No space left on device |
50 | ERROR_NOT_SUPPORTED | The request is not supported | Operation not supported |
51 | ERROR_REM_NOT_LIST | Windows cannot find the network path | Network path not found |
52 | ERROR_DUP_NAME | You were not connected because a duplicate name exists on the network | Duplicate network name |
53 | ERROR_BAD_NETPATH | The network path was not found | Network path invalid |
54 | ERROR_NETWORK_BUSY | The network is busy | Network congestion |
55 | ERROR_DEV_NOT_EXIST | The specified network resource or device is no longer available | Network device unavailable |
56 | ERROR_TOO_MANY_CMDS | The network BIOS command limit has been reached | Too many network commands |
57 | ERROR_ADAP_HDW_ERR | A network adapter hardware error occurred | Network hardware error |
58 | ERROR_BAD_NET_RESP | The specified server cannot perform the requested operation | Bad network response |
59 | ERROR_UNEXP_NET_ERR | An unexpected network error occurred | Unexpected network error |
60 | ERROR_BAD_REM_ADAP | The remote adapter is not compatible | Incompatible remote adapter |
61 | ERROR_PRINTQ_FULL | The printer queue is full | Print queue full |
62 | ERROR_NO_SPOOL_SPACE | Space to store the file waiting to be printed is not available | No print spool space |
63 | ERROR_PRINT_CANCELLED | Your file waiting to be printed was deleted | Print job cancelled |
64 | ERROR_NETNAME_DELETED | The specified network name is no longer available | Network name deleted |
65 | ERROR_NETWORK_ACCESS_DENIED | Network access is denied | Network access denied |
66 | ERROR_BAD_DEV_TYPE | The network resource type is not correct | Wrong network device type |
67 | ERROR_BAD_NET_NAME | The network name cannot be found | Network name not found |
68 | ERROR_TOO_MANY_NAMES | The name limit for the local computer network adapter card was exceeded | Too many network names |
69 | ERROR_TOO_MANY_SESS | The network BIOS session limit was exceeded | Too many network sessions |
70 | ERROR_SHARING_PAUSED | The remote server has been paused or is in the process of being started | Remote server paused |
71 | ERROR_REQ_NOT_ACCEP | No more connections can be made to this remote computer | Connection limit reached |
72 | ERROR_REDIR_PAUSED | The specified printer or disk device has been paused | Device paused |
80 | ERROR_FILE_EXISTS | The file exists | File already exists |
82 | ERROR_CANNOT_MAKE | The directory or file cannot be created | Cannot create file/directory |
83 | ERROR_FAIL_I24 | Fail on INT 24 | Critical error handler failure |
84 | ERROR_OUT_OF_STRUCTURES | Storage to process this request is not available | Out of system structures |
85 | ERROR_ALREADY_ASSIGNED | The local device name is already in use | Device name in use |
86 | ERROR_INVALID_PASSWORD | The specified network password is not correct | Invalid network password |
87 | ERROR_INVALID_PARAMETER | The parameter is incorrect | Invalid parameter |
88 | ERROR_NET_WRITE_FAULT | A write fault occurred on the network | Network write error |
89 | ERROR_NO_PROC_SLOTS | The system cannot start another process | No process slots available |
Directory and Path Errors (100-150)
Code | Constant | Description | Common Causes |
---|---|---|---|
100 | ERROR_TOO_MANY_SEMAPHORES | Cannot create another system semaphore | Semaphore limit reached |
101 | ERROR_EXCL_SEM_ALREADY_OWNED | The exclusive semaphore is owned by another process | Semaphore conflict |
102 | ERROR_SEM_IS_SET | The semaphore is set and cannot be closed | Semaphore in use |
103 | ERROR_TOO_MANY_SEM_REQUESTS | Too many semaphore requests | Semaphore request limit |
104 | ERROR_INVALID_AT_INTERRUPT_TIME | Cannot request exclusive semaphores at interrupt time | Invalid interrupt operation |
105 | ERROR_SEM_OWNER_DIED | The previous ownership of this semaphore has ended | Semaphore owner terminated |
107 | ERROR_PROCESS_ABORTED | The process stopped because of CTRL+C | Process terminated by user |
108 | ERROR_BROKEN_PIPE | The pipe has been ended | Broken pipe |
109 | ERROR_OPEN_FAILED | The system cannot open the device or file specified | Open operation failed |
110 | ERROR_BUFFER_OVERFLOW | The file name is too long | Filename/path too long |
111 | ERROR_DISK_FULL | There is not enough space on the disk | Disk full |
112 | ERROR_NO_MORE_SEARCH_HANDLES | No more internal file identifiers available | Search handle limit |
113 | ERROR_INVALID_TARGET_HANDLE | The target internal file identifier is incorrect | Invalid target handle |
114 | ERROR_INVALID_CATEGORY | The IOCTL call made by the application program is not correct | Invalid IOCTL |
115 | ERROR_INVALID_VERIFY_SWITCH | The verify-on-write switch parameter value is not correct | Invalid verify switch |
116 | ERROR_BAD_DRIVER_LEVEL | The system does not support the command requested | Unsupported driver level |
117 | ERROR_CALL_NOT_IMPLEMENTED | This function is not supported on this system | Function not implemented |
118 | ERROR_SEM_TIMEOUT | The semaphore timeout period has expired | Semaphore timeout |
119 | ERROR_INSUFFICIENT_BUFFER | The data area passed to a system call is too small | Buffer too small |
120 | ERROR_INVALID_NAME | The filename, directory name, or volume label syntax is incorrect | Invalid name syntax |
121 | ERROR_INVALID_LEVEL | The system call level is not correct | Invalid system call level |
122 | ERROR_NO_VOLUME_LABEL | The disk has no volume label | No volume label |
123 | ERROR_MOD_NOT_FOUND | The specified module could not be found | Module not found |
124 | ERROR_PROC_NOT_FOUND | The specified procedure could not be found | Procedure not found |
125 | ERROR_WAIT_NO_CHILDREN | There are no child processes to wait for | No child processes |
126 | ERROR_CHILD_NOT_COMPLETE | The child process has not completed | Child process running |
127 | ERROR_DIRECT_ACCESS_HANDLE | Attempt to use a file handle to an open disk partition for an operation other than raw disk I/O | Invalid direct access |
128 | ERROR_NEGATIVE_SEEK | An attempt was made to move the file pointer before the beginning of the file | Negative seek |
129 | ERROR_SEEK_ON_DEVICE | The file pointer cannot be set on the specified device or file | Seek not supported |
130 | ERROR_IS_JOIN_TARGET | A JOIN or SUBST command cannot be used for a drive that contains previously joined drives | Invalid JOIN target |
131 | ERROR_IS_JOINED | An attempt was made to use a JOIN or SUBST command on a drive that has already been joined | Drive already joined |
132 | ERROR_IS_SUBSTED | An attempt was made to use a JOIN or SUBST command on a drive that has already been substituted | Drive already substituted |
133 | ERROR_NOT_JOINED | The system tried to delete the JOIN of a drive that is not joined | Drive not joined |
134 | ERROR_NOT_SUBSTED | The system tried to delete the substitution of a drive that is not substituted | Drive not substituted |
135 | ERROR_JOIN_TO_JOIN | The system tried to join a drive to a directory on a joined drive | Cannot join to joined drive |
136 | ERROR_SUBST_TO_SUBST | The system tried to substitute a drive to a directory on a substituted drive | Cannot substitute to substituted drive |
137 | ERROR_JOIN_TO_SUBST | The system tried to join a drive to a directory on a substituted drive | Cannot join to substituted drive |
138 | ERROR_SUBST_TO_JOIN | The system tried to SUBST a drive to a directory on a joined drive | Cannot substitute to joined drive |
139 | ERROR_BUSY_DRIVE | The system cannot perform a JOIN or SUBST at this time | Drive busy |
140 | ERROR_SAME_DRIVE | The system cannot join or substitute a drive to or for a directory on the same drive | Same drive operation |
141 | ERROR_DIR_NOT_ROOT | The directory is not a subdirectory of the root directory | Directory not root |
142 | ERROR_DIR_NOT_EMPTY | The directory is not empty | Directory contains files |
143 | ERROR_IS_SUBST_PATH | The path specified is being used in a substitute | Path is substituted |
144 | ERROR_IS_JOIN_PATH | Not enough resources are available to process this command | Path is joined |
145 | ERROR_PATH_BUSY | The path cannot be used at this time | Path busy |
146 | ERROR_IS_SUBST_TARGET | An attempt was made to join or substitute a drive for which one of its directories is the target of a previous substitute | Invalid substitute target |
147 | ERROR_SYSTEM_TRACE | System trace information was not specified in your CONFIG.SYS file | System trace not configured |
148 | ERROR_INVALID_EVENT_COUNT | The number of specified semaphore events for DosMuxSemWait is not correct | Invalid event count |
149 | ERROR_TOO_MANY_MUXWAITERS | DosMuxSemWait did not execute; too many semaphores are already set | Too many mux waiters |
150 | ERROR_INVALID_LIST_FORMAT | The DosMuxSemWait list is not correct | Invalid list format |
Network and Remote File Errors (206-234)
Code | Constant | Description | Common Causes |
---|---|---|---|
206 | ERROR_FILENAME_EXCED_RANGE | The filename or extension is too long | Filename too long |
230 | ERROR_BAD_PIPE | The pipe state is invalid | Invalid pipe state |
231 | ERROR_PIPE_BUSY | All pipe instances are busy | All pipes in use |
232 | ERROR_NO_DATA | The pipe is being closed | Pipe closing |
233 | ERROR_PIPE_NOT_CONNECTED | No process is on the other end of the pipe | Pipe not connected |
234 | ERROR_MORE_DATA | More data is available | Additional data available |