Coding Agents & Terminal · recorded 2026-08-31 · applies to 1 tool(s) ✓ Verified

Problem: notepad.exe / cmd.exe reports command not found in WSL (interop disabled) —— Trove problem library

Verified 2026-08-31notepad.exe command not found in WSL — enable [interop] enabled=true + appendWindowsPath=true in /etc/wsl.conf, restart the distro.

Quick fix

# Inside WSL: turn both switches on (append the whole section if missing)
echo -e "[interop]\nenabled=true\nappendWindowsPath=true" >> /etc/wsl.conf
# Windows side: restart the distro to apply
wsl --terminate <distro-name>
wsl -d <distro-name>

What you will run into

In WSL, notepad.exe / cmd.exe / explorer.exe all report command not found, and which cmd.exe finds nothing; no Windows-side program can be invoked.

WSL interop (Windows/Linux interop) has been switched off — usually /etc/wsl.conf contains [interop] enabled=false or appendWindowsPath=false (copied from some "clean-up / security hardening" tutorial).

Why this happens

Interop is WSL's Windows/Linux interop mechanism (on by default): it registers Windows executables into Linux via binfmt so you can run .exe directly in WSL, and appends the Windows PATH to the Linux PATH.

Two switches in the [interop] section of /etc/wsl.conf: enabled=false directly disables the ability to run Windows processes (the binfmt registration is removed);

appendWindowsPath=false stops appending the Windows PATH (which cmd.exe finds nothing).

enabled controls "can it execute": at boot WSL registers (or does not register) the binfmt handler based on this switch; when off, any .exe is command not found.

appendWindowsPath controls "can it be found": WSL appends the Windows PATH to the end of the Linux PATH by default; when off, /mnt/c/Windows/system32/ is not in PATH, so even with interop on you must type the full path to run something.

The two switches are independent with different symptoms: enabled=false = running directly reports command not found; appendWindowsPath=false = which finds nothing but the full path /mnt/c/.../cmd.exe still runs.

Deterministic takeaway: first cat /etc/wsl.conf to inspect the [interop] section, then which cmd.exe to branch — check both before touching anything.

Step by step

1. Check the [interop] section — Must do

cat /etc/wsl.conf

2. Branch on the symptom — By diagnosis

  • enabled=false → change to enabled=true;
  • appendWindowsPath=false → change to appendWindowsPath=true;
  • Both lines present → restore both.

3. Restart the distro — Must do

# Windows side
wsl --terminate <distro-name>
wsl -d <distro-name>

4. Verify — Must do

which cmd.exe                # found = PATH is appended again
cmd.exe /c echo interop-ok   # runs = binfmt registration restored

How to confirm it works

which cmd.exe resolves to /mnt/c/Windows/system32/cmd.exe; cmd.exe /c echo ok executes normally (garbled Chinese in the console is a UTF-16 display issue and does not affect success).

Other environments

SwitchSymptom
enabled=falseRunning .exe directly reports command not found (binfmt not registered)
appendWindowsPath=falsewhich finds nothing, but full path /mnt/c/Windows/system32/cmd.exe still runs
Both offBoth symptoms combined

Symptom

$ notepad.exe
-bash: notepad.exe: command not found
$ which cmd.exe
(no output)

Signature: Windows programs collectively disappear inside WSL; /etc/wsl.conf has an [interop] section with false values; editing without restarting the distro also looks like "nothing happened".

Cause

Interop is on by default and implemented by registering binfmt at boot (enabled) and appending the Windows PATH (appendWindowsPath). Setting both switches to false in wsl.conf makes Windows processes unexecutable and unfindable in PATH. wsl.conf changes require a distro restart to take effect.

Solution

  1. cat /etc/wsl.conf to find the [interop] section;
  2. Set enabled=true + appendWindowsPath=true (append the whole section if missing);
  3. Restart the distro from Windows with wsl --terminate <distro-name>;
  4. Verify with which cmd.exe and a real run.
Verification Evidence
  • Mechanism check: Microsoft official docs (learn.microsoft.com/windows/wsl/wsl-config, [interop] section), URL in the evidence log;
  • Local comparison (2026-08-31): custom prebuilt WSL has no [interop] section (all defaults on) — which cmd.exe hits, cmd.exe /c echo runs; did not reproduce the fault (to avoid affecting the working environment);

Evidence details kept locally (2026-08-31)

Related canonicals

Read in order: precondition -> same root / same domain / related:

Applicable tools (1)

This problem is linked from the tool pages below — reachable from either side.

wsl

Source & evidence

Recorded Verified ✓ VerifiedApplies to 1 tool(s)
Entries contain locally measured or reviewable-source solutions; unmeasured items are explicitly labeled.

← Coding Agents & Terminal domain | Problem Catalog Experience | Facing another issue? Go to the Helpdesk