| Previous | Next |
| STATUS_BAD_FUNCTION_TABLE | STATUS_DIRECTORY_NOT_EMPTY |
STATUS_VARIABLE_NOT_FOUND
Inspect the actual process environment block, not only the current machine settings
STATUS_VARIABLE_NOT_FOUND refers to lookup in an environment block. Every Windows process has an environment block containing name/value pairs, and child processes normally inherit an environment derived from their parent. A user or system environment-variable change does not retroactively rewrite every already-running process environment.
This is why checking the Environment Variables control panel can be misleading. The variable may exist at machine or user scope while the failing service, scheduled task, IDE, or long-running process still has an older block. Conversely, a launcher can explicitly provide a custom environment and omit a variable that exists in its own parent environment.
Record the variable name and the environment block of the failing process. GetEnvironmentVariable reports ERROR_ENVVAR_NOT_FOUND when the name is absent from that block. Do not silently replace a missing security- or path-related variable with an empty string unless the application contract explicitly defines that behavior; absence and an empty value can have different meanings.
What to inspect
- The exact process and its environment block at failure time, including the spelling of the requested variable name.
- How the process was created and whether the parent supplied an explicit custom environment block.
- Whether the variable was added after process start or exists only in a different user, service, or machine scope.
References
- Microsoft: Environment Variables
- Microsoft: GetEnvironmentVariable
- Microsoft Open Specifications: NTSTATUS values
Looking for a different code? Search another status or error code.