2

I'm using commander to do a lot of job on Windows. My only problem is that I'm not able to run .sh files.

enter image description here

The image above says that there is no program associated to run .sh extension.

My workaround is to type bash file.sh But I rather to do not type bash everytume.

double-beep
  • 5,031
  • 17
  • 33
  • 41
Daniel Santos
  • 14,328
  • 21
  • 91
  • 174
  • Does it work if you put `#!/bin/bash` as first line in your script? – dmadic May 02 '18 at 21:06
  • does not works. – Daniel Santos May 02 '18 at 22:26
  • 1
    Looks like associating `.sh` files with `bash` won't work. I am also on windows and my git-bash is associated to `.sh` files. When I run `.\file.sh` it opens git-bash in separate window, executes the script and immediately closes the window. I believe that the best you can do is what this guy proposed https://stackoverflow.com/a/38317535/7411306. – dmadic May 02 '18 at 22:40

2 Answers2

6

You can try to run the below command to execute shell scripts on cmder windows 10.

sh test.sh
Sahil
  • 613
  • 10
  • 16
0

I find the easiest way is just to open a new tab (Ctrl + T) and switch to {bash::mintty as Admin}. Then you just run your scripts as usual ./test.sh

Roman Svitukha
  • 1,302
  • 1
  • 12
  • 22