How can you run Windows commands from Linux?
Experience Level: Junior
Tags: WSL
Answer
Use WSL.
Execute wsl.exe from command-line.
You can run any Windows executable, you just need to provide its extension.
As an example, instead of xcopy, run xcopy.exe.
You can also execute explorer.exe, notepad.exe, calc.exe, cmd.exe and many other executables.
Related WSL job interview questions
How do you copy output of commands in WSL to clipboard?
WSL JuniorHow can you do a backup of your WSL distro?
WSL JuniorHow can you start all containerized services described in docker-compose file directly from Windows when the docker-compose.yml file is stored in WSL?
WSL JuniorWhat is the advantage of Visual Studio Code Remote-WSL extension?
WSL JuniorHow can you edit files stored in WSL from Visual Studio Code that is running on Windows?
WSL Junior