1min.

1MIN · PRODUCTION ENGINEERING

A batch-file launch can find the executable and still miss its data

Raymond Chen explains a Windows program that worked when double-clicked but failed from a batch file. Explorer started it with the executable’s directory as its current directory; the script supplied the full executable path without changing directories. The program looked for supporting files relative to that working directory. Explicitly setting it fixed the customer’s case, showing why executable location and process context are different.

Raymond Chen · Microsoft · Oct 26, 2026

Why it matters

Reproducing a launch failure requires checking environment and working directory alongside the command being run.

More context

The October 26 account says the customer used pushd and popd to change and restore the directory. When comparing manual and scripted launches, inspect the current directory first; Chen lists App Paths environment changes as another possible check, not the cause established here.

Keep in mind

This is one diagnosed Windows application, not a universal explanation for batch failures. Programs can choose different resource-discovery rules, and other launch-context differences may still matter.

Original read

More engineering ideas, one minute at a time.

Explore more stories