When building Commerce Kickstart on Windows, using Drush Make, a customer has this problem:

ount_usage_handler_field_commerce_discount_analytics.inc): failed to
open stream: Invalid argument filesystem.inc:267

It results in the Drush error "Project commerce_discount (7.x-1.0-alpha6) could not be downloaded".

The build works on non-Windows platforms.

I notice that the file path is 264 characters long, and I suspect this is a problem of the Windows MAX_PATH constant (variously quoted on the web as being 255, 256, or 260 characters).

Is there a way to get around this?

I should note: I have read the drupal.org issue about Kickstart on Windows (https://www.drupal.org/node/1648992)

3 Answers 3


The Drush temporary directory can be set manually in the environment variable TEMP. So something like:

mkdir -p /c/drushtmp
TEMP=/c/drushtmp drush make [...]

can neatly solve the MAX_PATH problem for the temporary directory.


What about temporarily changing the TMP and/or TEMP variable to C:\tmp (in stead of C:\Users\User\AppData\Local\Temp)? It might be just enough ;-)

  • Thanks, I answered with that myself about 2 minutes before you :) see below
    – pjcdawkins
    Dec 8, 2015 at 16:38

It appears there is an MSDN article that has a solution:


To specify an extended-length path, use the "\?\" prefix. For example, "\?\D:\very long path".

So, perhaps you can modify the install script to use this prefix before trying to install?

  • Thanks, I had hoped there might be some kind of way to do this at the OS level, because patching Drush is a little bit out of scope although probably worth trying...
    – pjcdawkins
    Dec 8, 2015 at 0:06
  • It turns out PHP can't use that prefix, it prevents it deliberately according to Pierre Joye in this php-internals thread: serverphorums.com/read.php?7,627200
    – pjcdawkins
    Dec 8, 2015 at 16:37
  • Blerg! (facepalm)
    – joshmiller
    Dec 8, 2015 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.