Note: There is more recent documentation on installing Drush on Windows available.

Love drush!!!
i have setup drush for drupal6 on my sandbox wich is running xampp
and just wanted to share how to set it up to work natively (without doing that cygwin stuff)

You need to install the following external applications:
http://gnuwin32.sourceforge.net/packages/libarchive.htm (we will use the gnuwin32 "bsdtar" package instead of the "tar" package because it looks death )
http://gnuwin32.sourceforge.net/packages/gzip.htm
http://gnuwin32.sourceforge.net/packages/wget.htm

when you have installed these you have to preform a copy of the bsdtar.exe,
drush will look for the "tar" executable, which isn't there
so copy the file C:\Program Files\GnuWin32\bin\bsdtar.exe to C:\Program Files\GnuWin32\bin\tar.exe
(maybe someday drush will do this automagicly or enable a config parameter for it)

next we will set the path settings so we can access the binaries from the commandline
right click on your system icon and choose properties then select advanced settings
on that page you'll see something like environment variables
when you click that you see a configuration line named PATH
select that one and click edit
and add something like this line to the end of the current value";C:\xampp\php;C:\path_to_my\drupal6\sites\all\modules\drush;C:\Program Files\GnuWin32\bin" (without the quotes)
the semicolon separates the paths. first path is the location of your php.exe, second path is to your drush.bat location, third path is to your tar/gzip/wget binaries
(btw The order doesn't matter)

Now you need to locate your drush.bat file which is located in the root directory of your drush module
"C:\path_to_my\drupal6\sites\all\modules\drush.bat"
Open this file and append the full path to the drush.php file
@php.exe C:\path_to_my\drupal6\sites\all\modules\drush\drush.php %1 %2 %3 %4 %5 %6 %7 %8 %9

THAT'S IT, happy drushing
and don't forget to enable drush module in you drupal installation ;)

ps I use this mainly for "pm" commands, i haven't worked with svn or cvs but you might get it to work with the knowledge shared above

Comments

moshe weitzman’s picture

so, what should we do in drush package to make it easier for windows user?

Progression’s picture

Can someone please spell this out in laymens terms. I would love to start using this tool but never touched linux. Please explain for the people that install drupal using fantastico onto company's like bluehost. We're a different breed 8P

opdavies’s picture

Check out this screencast from Elliot Rothman at Drupal School...

http://blip.tv/file/2500479/

Island Usurper’s picture

Status: Closed (works as designed) » Active

To answer Moshe's question, I'd say that README.txt should list the requirements for at least the core features of Drush. I would also recommend listing requirements for each command in each drush help [command] so all of the contribs can list any extra programs that some people might not have installed yet.

moshe weitzman’s picture

README for core should indeed have good docs for windows (please help). Commands can probaly use hook_COMMAND_validate to check for requirements and log an error if missing. Thats enough IMO.

I just committed some initial docs on validate and other hooks - http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/drush/drush...

juicytoo’s picture

Thanks for this.

cheers

OldAccount’s picture

Thanks, this got it working on my dev site running on Windows and Zend server.

johnbarclay’s picture

Thanks also. This worked for me also on a Windows 2008 server with the standard php 5.2 intall for fastcgi. I added a child page to the drush documentation at: http://drupal.org/node/594744

moshe weitzman’s picture

Status: Active » Closed (fixed)

Old, and inaccurate now

harcher’s picture

I'm on windows XP

Why is this old and inaccurate please?

GiorgosK’s picture

@hga77
I followed the instructions and they seem to work

Disney’s picture

Hello,

first of all, thanks for the information! Due to respect to your work, but I do not understand something. The site "http://drupal.org/project/drush" says that drush ought not to be a module, but in contrast you describe here to install it like a module and to enable it like a module. I downloaded "drush 3.3 all versions" from the given link above and I couldnt see any file in there called "xxx.module" or something like that. I also saw some other sites describing to install drush for windows, but not in the same way as you do ( I mean as a module in the module folder of a drupal installation). So now, I am a bit confused. What is that what I do not understand? Can I just put the drush folder in C:/, so having a path "C:/drush" without putting it in any module folder within any drupal installation and without enabling it as a module??? Or what is the different if I do it other way around?

Thanks!!!

GiorgosK’s picture

@disney
no its not a module
read the readme.txt and if you get stuck open up an issue (different from this one - this one is closed) describing what you did (with enough detail for someone to reproduce the steps) and where you are stuck