dist-archive-command icon indicating copy to clipboard operation
dist-archive-command copied to clipboard

'zip' is not recognized as an internal or external command, operable program or batch file.

Open kmgalanakis opened this issue 7 years ago • 13 comments

I'm on Windows 10 and even though I can run the zip command on my terminal, I keep getting this error

'zip' is not recognized as an internal or external command, operable program or batch file.

The path for the zip.exe is already included in my PATH.

Any clues why this happens?

kmgalanakis avatar Feb 04 '18 13:02 kmgalanakis

Yes I do @kmgalanakis ! The framework needs changes to properly support Windows. In this case the issue is caused (ultimately) by the environment (in particular PATH) not being passed to proc_open(). Also this command should probably use the Extractor class anyway instead.

gitlost avatar Feb 04 '18 16:02 gitlost

Minutes after posting the issue, I dug through the code and immediately noticed the issue the proc_open. Is there any roadmap for that refactor?

kmgalanakis avatar Feb 05 '18 06:02 kmgalanakis

Always the way isn't it?! The roadmap is here https://make.wordpress.org/cli/handbook/roadmap/ and as you can see is currently a bit vague but will hopefully be firmed up over the coming week or so...

gitlost avatar Feb 05 '18 15:02 gitlost

Experiencing the same issue, any updates ?

bondansebastian avatar Aug 09 '18 06:08 bondansebastian

Hi @bondansebastian This commend is not reedy yet for WP-CLI 2.. If you wont help as in converting it to new format see https://github.com/wp-cli/dist-archive-command/issues/26 and join as on slack in #cli channel.

wojsmol avatar Aug 09 '18 06:08 wojsmol

@bondansebastian To be clear this command will by converted shortly.

wojsmol avatar Aug 09 '18 07:08 wojsmol

Hi @wojsmol #26 has been closed, still the command doesn't work in windows machine. I would be glad to help converting it, just need more information about what to fix.

bondansebastian avatar Apr 20 '19 12:04 bondansebastian

@bondansebastian Command was converted to WP-CLI 2 structure. Please post wp --info output.

wojsmol avatar Apr 20 '19 16:04 wojsmol

@bondansebastian Command was converted to WP-CLI 2 structure. Please post wp --info output.

OS:     Windows NT 10.0 build 17134 (Windows 10) i586
Shell:  C:\Program Files\Git\usr\bin\bash.exe
PHP binary:     C:/xampp/php/php
PHP version:    7.1.15
php.ini used:   C:\xampp\php\php.ini
WP-CLI root dir:        C:\Users\Bondan\AppData\Roaming\Composer\vendor\wp-cli\wp-cli
WP-CLI vendor dir:      C:\Users\Bondan\AppData\Roaming\Composer\vendor
WP_CLI phar path:
WP-CLI packages dir:    C:\Users\Bondan/.wp-cli/packages/
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.1.0

bondansebastian avatar Apr 22 '19 03:04 bondansebastian

Hi @kmgalanakis Here's my solution to zip files using Windows 10 & PowerShell Scripts: InfoZip

  • Find download section: ftp://ftp.info-zip.org/pub/infozip/win32/
  • Find your file, there are many but i only needed this: ftp://ftp.info-zip.org/pub/infozip/win32/zip300xn-x64.zip
  • Put zip.exe path as a enviroment variable path and it's done!

After all you can zip everything by using zip destination.zip source Try zip --help to see many others functions such as recursive zip into directories.

luisvenezian avatar Sep 14 '20 18:09 luisvenezian

@venezianluis I've already tried this. Didn't resolve my issue.

kmgalanakis avatar Dec 18 '20 12:12 kmgalanakis

Hey people, any solution to this problem yet? I am following a python pdf book for python beginners, making some backup app as homework and i am getting 'zip' is not recognized as an internal or external command, operable program or batch file.

Lazar014 avatar Feb 12 '23 00:02 Lazar014

Is there any reason why the PHP ZipArchive is not used instead of relying on the system to have a zip command implemented?

VoHoTv avatar Jul 20 '23 20:07 VoHoTv