Running drush on windows (I know...) Tried reinstall of drush, msysgit and wamp. It started after running sql-sync and rsync. Incidentally that led to permissions problems on the new files so that sql sync never actually worked but that's a separate problem now.

** EDIT: So, several reinstalls later and I've narrowed the problem. I haven't seen this exact error on Google at but there are variations on it ('git' is not a recognized command for example) and it appears that it is a windows error when the .bat file or executable cannot be found. I have poured over the environment variables several times and tried the windows installer (5.8 just released for windows) leaving it to install the variables in their default locations. Drush works fine in the drush window and it even works in the msysgit window but with this error constantly before it

'mode' is not recognized as an internal or external command,
operable program or batch file.
Drupal version                  :  6.26
Site URI                        :  http://default
Database driver                 :  mysql
Database hostname               :  localhost
Database username               :  dev
Database name                   :  mydevdb
Database                        :  Connected
Drupal bootstrap                :  Successful
Drupal user                     :  Anonymous
Default theme                   :  my_theme
Administration theme            :  seven
PHP configuration               :  C:\Program Files (x86)\Drush\Php\php.ini
Drush version                   :  5.8
Drush configuration             :
Drupal root                     :  c:/wamp/www/dev_testulearn
Site path                       :  sites/default
File directory path             :  sites/default/files
Temporary file directory path   :  tmp

Appreciate any help you can give!


Lionsharz’s picture

Version:All-versions-3.x-dev» 7.x-5.8

Additionally I am getting a similar error when trying to run sql-sync

'mysqldump' is not recognized as an internal or external command, operable program or batch file. Database dump failed                                                     [error]

Any ideas on that one? This is happening in the Drush bash window and the msysgit window also. This was working previously - why can't it see or execute the commands?


Lionsharz’s picture

Component:Miscellaneous» Windows Installer
Assigned:Unassigned» Lionsharz
jonhattan’s picture

Assigned:Lionsharz» Unassigned
Status:Active» Fixed

It seems you don't have the path to those commands in the PATH env variable.

Tagging a reference to #1820166: Add command(s) to check if external commands are available.

Lionsharz’s picture

Great! Thanks for the tip - I figured it out. Just for future googling reference and anyone else on windows (running wamp for example) to define the paths

1) Advanced system settings > Environment Variables (of your user not the system)
2) Add the variable C:\wamp\bin\mysql\mysql5.5.16\bin\ (or whatever version of mysql that is currently enabled on wamp)

Note that I also had to remove the drush path-to-php and replace it with the wamp version - add this line to the user environment variables C:\wamp\bin\php\php5.3.6 (or whatever version of PHP is currently selected in your wamp)

This may be of help with rsync

And this may be of help if you are having trouble writing to the sql dump directory defined in your alias file

Lionsharz’s picture

Title:'mode' is not a recognized command» 'mode' or 'mysqldump' or 'xxx' is not a recognized command

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

friesk’s picture

Hi, there. Learning the ins and outs of a the various ways to upgrade from D6 to D7 here. I get stuck in stage 12-a now instead of just getting stuck at the status report point. I *think* I am having similar or same difficulties, but a little flummoxed when it comes to naming the mysql and php file path variable in the environment variables on an winXP system. I am at the right place, but if I call it "PATH" it overwrites it (the old one from the Drush install) rather than adding one. What did you call your wamp-specific variables? So, while it seems Ok to overwrite the PHP path, what would I name the mysql path, which is what *appears* to be the problem? I am hoping the file path I have (C:\wamp\bin\mysql\mysql5.1.36\bin) will work, though it does not look like the php path from the install (C:\Documents and Settings\All Users\Application Data\Drush\;C:\Program Files\Drush\GnuWin32\bin;C:\Program Files\Drush\Php)--for better or worse. I think I tried calling it 'mysql' w/o luck. Any and all help is most appreciated!

Lionsharz’s picture

Hi There - not totally sure I understand your position in the process. First up might I recommend Rapid Environment Editor for windows. Great free program that allows you to see your system variables on the left (basically don't touch them) and your user environment variables on the right (you can edit these). Fiddling around trying to edit these variables through Windows is a pain and quite 90's if you ask me.

Looks to me like you have the correct MySQL variables there (maybe a trailing slash might help you...?) But you are mixing the PHP / mysql / wamp and Drush paths in your question. You know they are two different elements I guess.

Drush can use the php in your WAMP stack without any problems. You could try removing (don't delete it until you know its worked) its own PHP folder. Running two PHPs on one Windows system can cause issues. Imho its best to leave well enough alone once you get it functioning. It doesn't really matter where you choose to point these variables for Drush so long as they match the folder.

My Drush Variables:
C:\Program Files (x86)\Drush\GnuWin32\bin
C:\Program Files (x86)\Drush\Php
C:\Program Files (x86)\Drush\cwRsync\bin

With wamp these variables you've not got much choice - they need to be in your wamp/bin/... for wamp conf to use them
My wamp specific variables (in my User Variables) are

I have two versions of MySQL running cos I need to and had the same with the PHP but it caused no end of hassle - breaking Drush at times and WAMP too so I settled on one version.

friesk’s picture

This really helps. MOST appreciated!

friesk’s picture

Issue summary:View changes

More info