3

This question already has an answer here:

I'm using the Windows Subsystem for Linux WSL. I can start and exit the Ubuntu command-line with ubuntu or exit respectively, but I also want to run cmd commands there.

How can I start cmd.exe from within the WSL terminal?

marked as duplicate by Eric Carvalho, muru command-line Dec 6 '17 at 10:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • I use my ubuntu command line for nearly all things, sometimes i need to run a windows command in the directory where i am working, i would like to switch to the windows console for a moment instead of starting a new and seperate windows terminal. But an explenation of how to use windows cmd.exe commands within ubuntu would be usefull too – Peter verleg Dec 5 '17 at 9:26
  • 2
    @dessert This answer is not a duplicate of that question. The question that you linked to is about how to start a Windows executable in Ubuntu. This question however is about how to start a Windows executable in Windows Subsystem for Linux (WSL) ( en.wikipedia.org/wiki/Windows_Subsystem_for_Linux ). – karel Dec 5 '17 at 10:52
  • 1
    Questions relating to Windows Subsystem for Linux, the compatibility layer developed by Canonical and Microsoft to run Ubuntu programs natively in newer versions of Windows, are on topic at Ask Ubuntu. wsl tag at Ask Ubuntu. – karel Dec 5 '17 at 11:18
  • 2
    @dessert Edited the question and added the wsl tag. I hope this edit will be sufficient to scare off predatory downvoters and reviewers. – karel Dec 5 '17 at 11:21
5

From within a Bash/WSL console you can invoke Windows executables by specifying the (correctly-cased) name of the executable, including its .exe extension (example: notepad.exe [filename]). To start a new cmd shell and (optionally) run a command/executable program type:

cmd.exe  
  • 1
    and you dont need an emulator like WINE or so? – Abel Tom Dec 5 '17 at 11:00
  • 1
    In Windows Subsystem for Linux (WSL) you don't need Wine. Reference: Interop between Windows and Bash – karel Dec 5 '17 at 11:02
  • 1
    @dessert Okay, i misunderstood the question, the questioner is on Windows the whole time. Sorry, but does this question not belong in some Windows forum.? – Abel Tom Dec 5 '17 at 11:09
  • 4
    Questions relating to Windows Subsystem for Linux, the compatibility layer developed by Canonical and Microsoft to run Ubuntu programs natively in newer versions of Windows, are on topic at Ask Ubuntu. wsl tag at Ask Ubuntu. – karel Dec 5 '17 at 11:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.