Installing Drush on Windows
With Drush you can greatly reduce the amount of time needed to setup and upgrade your Drupal installations - even if you're not a command line expert. If you haven't used Drush yet, you've probably at least heard of it.
This walkthrough will list the steps to get Drush setup on Windows. I'm using WAMP for my localhost. If you're using something else some of your paths might be different, but the setup process is the same.
Drush is a command line shell and Unix scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.
To learn more about getting started with Drush, watch the screencast Drupal School: Jumpstart with Drush and Command Line.
Get Drush
Download the Drush project from drupal.org.
Where to Install Drush?
Drush is not a module, not specific to a Drupal site or Drupal version (5.x, 6.x...). While you can place it in sites/all/modules, it makes more sense to install it outside of your Drupal directory for example in C:/ or C:/wamp/www.
Installation on Windows
- Install additional applications:
- LibArchive: http://gnuwin32.sourceforge.net/packages/libarchive.htm
Libarchive is a programming library that can create and read several different streaming archive formats, including most popular tar variants, several cpio formats, and both BSD and GNU ar variants.
- GZip: http://gnuwin32.sourceforge.net/packages/gzip.htm
GZip is a compression utility designed to be a replacement for compress. Its main advantages over compress are much better compression and freedom from patented algorithms.
- WGet: http://gnuwin32.sourceforge.net/packages/wget.htm
GNU Wget is a free network utility to retrieve files from the World Wide Web using HTTP and FTP.
- LibArchive: http://gnuwin32.sourceforge.net/packages/libarchive.htm
- Use bsdtar for tar, it's more reliable. Copy the file C:\Program Files\GnuWin32\bin\bsdtar.exe to C:\Program Files\GnuWin32\bin\tar.exe
http://drupal.org/node/594744
-
Setup PATH environment variables for Drush, PHP, and tar/get/wget binaries installed above:
Control Panel > System > Advanced System Settings > Environment Variables
Select Path and click Edit.
Append your paths (separated by semicolons) to php.exe, drush.bat and tar/get/wget binaries to the Path Variable value. This field is not so usable as a textfield. You'll probably want to copy the existing value to a text editor, append your new entries and paste everything back into the field.
You're paths should look something like this, but they may be different depending on your setup.
;C:\wamp\bin\php\php5.3.0;C:\drush;C:\Program Files\GnuWin32\binMySQL Path
Check to make sure your Path variable includes the path to the folder containing mysql.exe. While this isn't necessary to use Drush, being able to use MySQL via the command line comes in handy.
;C:\wamp\bin\mysql\mysql5.1.36\bin


If you have an open command window, you will need to reopen it to refresh your path variables.
-
Edit drush.bat located in the root of your Drush folder to include the full path to your PHP installation.
@C:\wamp\bin\php\php5.3.0\php.exe "%~dp0drush.php" %*
Testing your Drush Setup
Open the Command Line, type drush or drush --help and hit enter. If installed correctly you should see a help listing of Drush commands.

Comments
Great instructions. Worked first time for xampp just changing paths where necessary. Thanks!
for those who get the error message ""Class 'Console_Table' not found"
go to comment #3 on http://drupal.org/node/563170. Works like a charm!
Thanks for this post Jocelyn!
nice installation guide...
thanks!
Add comment
jsfwd on Twitter
- Must see... Arcade Fire's new HTML5 music experience 'The Wilderness Downtown' http://bit.ly/cVcoDy 4 days 16 hours ago
- Drupal Camp Toronto 2010 - October 15 & 16 - http://2010.drupalcamptoronto.org 2 weeks 20 hours ago
- Rob Ford "I can't support bike lanes" when cyclists get hit "it's their own fault" http://youtu.be/nySs1cEq5rs #voteTO #bikeTO 2 weeks 4 days ago
- @jswaby me thinks I'll keep it ;) 2 weeks 5 days ago
- Found a BlackBerry Bold & chargers in the recycling this morning. Recycling #fail. Me #win. 2 weeks 5 days ago
- #MMA coming to Ontario in 2011 (it's about time) http://bit.ly/ddK6AY 2 weeks 5 days ago
- Twitter Tweet Button for Drupal http://t.co/FaAAnTD via @jsfwd 2 weeks 6 days ago
- Twitter reclaiming the Tweet button http://bit.ly/cjwYie 3 weeks 2 days ago
- RT @paulosman: Next #OpenWebTO meeting is on August 30th at #csiTO! Come learn about the #Salmon protocol from @walkah http://bit.ly/dtAdKp 3 weeks 3 days ago
- @DilbertDave Some Drupal contrib modules need to be patched to work with PHP 5.3. If you can use 5.2.x. 3 weeks 5 days ago
That's awesome, thanks for the guide and to Seb for the 'Console_Table' not found error fix.
Had to set this up on a windows box after having to move from a mac setup.