Calling Windows apps from Linux
In Chapter 4, Windows to Linux Interoperability, we saw how we can use the wsl
command to call Linux applications from Windows. Going the other way (calling Windows applications from Linux) is even easier! To see this in action, fire up a terminal in your WSL distro and run /mnt/c/Windows/System32/calc.exe
to launch the Windows Calculator app directly from Linux. If Windows is not installed in C:\Windows
, then update the path to match. In this way, you can launch any Windows application from a terminal in your WSL distros.
In the case of Windows Calculator (and many other applications), WSL actually makes it even easier. This time, type calc.exe
in your terminal and Windows Calculator will still run. The reason this works is that calc.exe
is in your Windows path and (by default) WSL will map your Windows path to the Linux path in your WSL distros. To demonstrate this, run echo $PATH
in the terminal:
$ echo $PATH /home/stuart/.local/bin:/home/stuart...