How to get Drush in my path in Windows 10? I have Drush 9 installed on Windows 10.  I installed it via Composer using Lando.

I want to put this drush in my system path so that I can use it from cmd.exe, Powershell, and so on. I want to do this because I am trying to run Drupal Behat Extension tests with the Drush driver, which requires drush to be in the path.

What I tried

Windows 10 Control Panel -> System -> Edit environment variables

Under "User variables for MYUSERNAME", I added:


Variable: LANDO_FRIENDS
Value: C:\pathtowebsiteinstalledbycomposer\vendor\bin


Then I rebooted and tried to run drush:


  drush : The term 'drush' is not recognized as the name of a cmdlet,
  function, script file, or operable program. Check the spelling of the
  name, or if a path was included, verify that the path is correct and
  try again.


So then, from PowerShell, I changed to the \vendor\bin directory and ran ./drush.  This opened up a prompt How do you want to open this file?

I don't understand why this is happening.

Here's what does work:


I can run drush from Powershell using lando, i.e., lando drush status.
I can open up a bash shell with the Windows Linux Subsystem and go to /vendor/bin and enter ./drush, which causes drush to load normally.


So drush is definitely installed, but how do I use it from Powershell/cmd.exe?
The variable will be "Path". Just select that one and edit it then add new line.

You have to download the drush.phar file from here: https://github.com/drush-ops/drush-launcher/releases/tag/0.6.0

Then you have to change the file name from 'drush.phar' to just 'drush' and put that file somewhere and that location needs to be in your path. I put mine in both my system path and user path. Once that is done you shoud be able to call drush from your drupal directory if it was installed with composer.