How to execute windows cmd commands on windows ubuntu?


New Member
I recently got windows ubuntu. I want to run a windows cmd command on windows ubuntu. Is that possible.

For example, I want to open an exe file. In cmd, you can just type Executable.exe to execute that file. If I do that in windows ubuntu, it would result in Executable.exe: command not found. How would I run that windows cmd command in windows ubuntu?


Thành viên BQT
What you call "cmd commands" could be one of two things:

  1. External commands, such as .exe files, or files with type associations such as .jar. These must be in a directory referenced in the PATH environment variable, or in the current working directory.
  2. Internal commands, such as TYPE, ECHO, etc. are commands that are directly recognised by the cmd.exe interpreter.
Your Ubuntu system runs a version of the Bash shell. In Bash, you can run external commands just by typing their name, as long as they're in the PATH. Bash doesn't recognise executables in the current directory, so you must explicitly put ./ in front.

To get Bash to execute cmd.exe commands, you need to run cmd.exe and pass it a command with the /c option, e.g. cmd.exe /c echo Hello world. You can also use cmd.exe /c for external commands too, so this option can be useful if you're not sure if the command is internal or external.