Install Drush on Windows - The easy way.
Follow the Windows-specific instructions provided on Github:
You should find a link to a Windows installer there. Here is the current link (as of 28 January 2015):
The Windows installer is compiled and managed separately from the rest of the Drush github repository, and so you should not be surprised if the MSI installer version offered does not quite match the latest version of Drush.
As of September, 2014, the Drush 6 Windows installers works well on Windows XP, Vista, 7, and 8. This is the recommended method for installing Drush on Windows. It is is much simpler than the manual processes described below.
You may want to read the either of the following articles if you want to install Drush 6 or 7 on a Windows machine.
- Installing Drush 7 on Windows 7 and 8.
- Installing Drush 6 on Windows XP, 7, 8 so it runs in a Git Bash Window.
How to manually upgrade to Drush 5.x and 6.x on Windows XP and 7
Drush 5.7 Makes does not work in Windows 7 - but drush 6 does!
The Drush Make command does not work in Windows 7 / Vista, when using Drush release 5.5, 5.6, or 5.7. However, the current development version of Drush fixes this issue!
So, if you still cannot find an suitable Drush installer for your Windows version, take a look at this article, How to manually upgrade to Drush 5.x and 6.x on Windows XP and 7, which provides detailed instructions for manually installing the latest development version of Drush in Windows.
Install Drush on Windows - The hard way.
The most recent official Drush readme.txt file contains the basics of installing drush. Some special considerations need to be made when installing on windows. The following Tutorial is for Drush 5 and based on the process outlined at: http://drupal.org/node/330023
Some people recommend viewing Installing WAMP, Drush & Drupal on Windows 7 which follows the instructions below.
Follow the instructions below to install Drush on Windows the hard way (possibly useful if you had trouble with the installer above).
Step by Step
- Open http://drupal.org/project/drush and download and extract "All-versions-5.x-dev" to C:\ so drush.bat can be found at C:\drush\drush.bat.
- Install the following external applications.
- Use bsdtar for tar. Its more reliable. Copy the file C:\Program Files\GnuWin32\bin\bsdtar.exe to C:\Program Files\GnuWin32\bin\tar.exe
- Set PATH environment variable to include drush, php, and binaries installed above.
add something like this line to the end of the current value
Note : If you have different path of php then change it.
In my case i have following path
The semicolon separates the paths. Paths are those to: php.exe, drush.bat location,and tar/gzip/wget binaries. You will need to reopen your shell/command prompt window to have the path variables refreshed.
or enter on the command line:
setx PATH "%PATH%;C:\ProgramData\Drush\;C:\Program Files (x86)\Drush\GnuWin32\bin;C:\Program Files (x86)\Drush\Php;C:\Program Files (x86)\Drush\cwRsync\bin;"
- Open the Command Prompt, type "drush status" and hit enter. You should see the following output:
PHP configuration : C:\php\php.ini
Drush version : 5.0-dev
Drush configuration :
Drush alias files :
If you did, installation is complete. If not, keep on reading.
This step may no longer be needed. See comments.
Now you need to locate your drush.bat file which is located in the root directory of your drush module
Open this file and append the full path to the drush.php file:
c:\php\php.exe C:\drush\drush.php %1 %2 %3 %4 %5 %6 %7 %8 %9
You just need to put the full path to php, no need to put the full path to drush:
c:\php\php.exe "%~dp0drush.php" %1 %2 %3 %4 %5 %6 %7 %8 %9
Check how to upgrade drush in windows to work with drupal 8
Other How Tos for Installing Drush on Windows
- http://vimeo.com/15371661 - Video, Installing WAMP, Drush & Drupal on Windows 7
- Installing Drush on Cygwin: http://drupal.org/node/1432756
- Installing WAMP, Drush & Drupal on Windows 7 (Video)
Gotchas for Windows
- gnuwin32 tar problem. Gnuwin32 tar fails silently because it can not handle windows file paths correctly. In verbose mode error is visible. http://drupal.org/node/483110#comment-2109272
Configuration files (i.e. site alias files) locations
If you are using the drush.ws Windows installer and have not modified the installation paths, etc., finding where to set up your Drush alias files is challenging. The information is there, but not readily accessible. Drush will look through a sequence of directories, each less specific to a site than the other as defined in the C:\ProgramData\examples\example.drushrc.php file. In those comment, the references are for Linux based operating system. On Windows the following locations should help:
- #4, the User's .drush folder, is usually located at C:\Users\user_name\.drush. But that location is determined by the environment variables HOME or HOMEDRIVE/HOMEPATH. Double check by a SET command at the command line.
- #6, the Drush installation folder, is usually located at C:\ProgramData\Drush. In this case do not use a .drush subdirectory, put the files into the installation folder.
Notes below Will be converted into batch install script
# install gzip, tar, wget command line binaries
# download drush. Using c:\drush as location in this example
# set PATH environment variables
# edit drush.bat
Above Directions Work on...
- Windows server 2008. R2 Tested by: johnbarclay (11/14/2010)
- Windows server 2008. Tested by: johnbarclay (10/2/2009)
- Windows Vista 64-bit Business. Tested by: Gman (10/20/2009)
- Windows Vista 32-bit Business. Tested by: buckley (2010-01-10)
- Windows Vista 32-bit Home Premium. Tested by: decibel.places (2010-10-27)
- Windows XP SP3 32-bit. Tested by: phoenix (10/23/2009)
- Windows XP SP2 32-bit. Tested by: vmi (01/19/2012)
- Windows 7 Home Premium 32-bit. Tested by: azovsky (06/29/2010)
- Windows 7 Enterprise 64-bit. Tested by: kurkuma (02/07/2011)
- Windows 8 Professional 64-bit. Tested by: pvasili (10/07/201.)