Instead, you’ll have to introduce a compatibility layer to be able to run such scripts in Windows. There are various ways to do this, with the popular ones being Windows Subsystem for Linux, Cygwin, and Git Bash. In this article, we’ve listed all the necessary steps to run Shell Scripts in Windows using these methods.

Windows Subsystem For Linux

The first method is to install a Linux distro through the Windows Subsystem for Linux feature. Cygwin and Git are convenient, but users often have difficulty running complex shell scripts and Linux applications with them. As such, WSL is the recommended option. Here are the necessary steps for this:

Use Cygwin

Cygwin is a run time environment used to run code designed for Unix environments on Windows. Here’s how you can run shell scripts in Windows using Cygwin:

Use Git Bash

During its installation, Git optionally adds some UNIX tools to the PATH in Windows, with sh.exe being one of them. Here’s how you can install Git and run shell scripts using Git bash:

How To Run Sh  Or Shell Script In Windows - 98How To Run Sh  Or Shell Script In Windows - 71How To Run Sh  Or Shell Script In Windows - 1How To Run Sh  Or Shell Script In Windows - 84How To Run Sh  Or Shell Script In Windows - 43How To Run Sh  Or Shell Script In Windows - 34How To Run Sh  Or Shell Script In Windows - 13How To Run Sh  Or Shell Script In Windows - 2How To Run Sh  Or Shell Script In Windows - 38How To Run Sh  Or Shell Script In Windows - 97


title: “How To Run Sh Or Shell Script In Windows” ShowToc: true date: “2022-11-30” author: “Marissa Sum”


Instead, you’ll have to introduce a compatibility layer to be able to run such scripts in Windows. There are various ways to do this, with the popular ones being Windows Subsystem for Linux, Cygwin, and Git Bash. In this article, we’ve listed all the necessary steps to run Shell Scripts in Windows using these methods.

Windows Subsystem For Linux

The first method is to install a Linux distro through the Windows Subsystem for Linux feature. Cygwin and Git are convenient, but users often have difficulty running complex shell scripts and Linux applications with them. As such, WSL is the recommended option. Here are the necessary steps for this:

Use Cygwin

Cygwin is a run time environment used to run code designed for Unix environments on Windows. Here’s how you can run shell scripts in Windows using Cygwin:

Use Git Bash

During its installation, Git optionally adds some UNIX tools to the PATH in Windows, with sh.exe being one of them. Here’s how you can install Git and run shell scripts using Git bash:

How To Run Sh  Or Shell Script In Windows - 29How To Run Sh  Or Shell Script In Windows - 52How To Run Sh  Or Shell Script In Windows - 15How To Run Sh  Or Shell Script In Windows - 51How To Run Sh  Or Shell Script In Windows - 60How To Run Sh  Or Shell Script In Windows - 89How To Run Sh  Or Shell Script In Windows - 33How To Run Sh  Or Shell Script In Windows - 70How To Run Sh  Or Shell Script In Windows - 77How To Run Sh  Or Shell Script In Windows - 22