# ERROR: NoMethodError: undefined method \`windows\_zipfile'

**URL:** <https://discourse.chef.io/t/error-nomethoderror-undefined-method-windows-zipfile/13562>\
**Category:** Chef Infra (archive)\
**Created:** [August 30, 2018, 4:54am UTC](https://discourse.chef.io/t/error-nomethoderror-undefined-method-windows-zipfile/13562 "2018-08-30T04:54:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![deepaksingla](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/deepaksingla/32/2321_2.png) [@deepaksingla](https://discourse.chef.io/u/deepaksingla)\
**Post date:** [August 30, 2018, 4:54am UTC](https://discourse.chef.io/t/error-nomethoderror-undefined-method-windows-zipfile/13562/1 "2018-08-30T04:54:40Z")

</div>

Hi

I am trying to unzip the directory using below recipe

```auto
windows_zipfile 'C:/Software/Hello' do
   source 'C:/Software/Hello.zip'
   action :unzip
end

```

But I am facing below error:

```auto
[2018-08-29T21:41:44-07:00] ERROR: Remote chef-client error follows:
[2018-08-29T21:41:44-07:00] ERROR: NoMethodError: undefined method `windows_zipfile' for cookbook: install_unZIP_Hello, recipe: default :Chef::Recipe
Did you mean? windows_pagefile

```

Actually I am successfully able to install 7.zip using below recipe

```auto
windows_package '7zip' do
  source 'http://www.7-zip.org/a/7z938-x64.msi'
end

```

but I don't know, how to use 7zip to extract zip files through a recipe?

---

<div class="post-metadata">

**Author:** ![Larryc](https://avatars.discourse-cdn.com/v4/letter/l/c6cbf5/32.png) [@Larryc](https://discourse.chef.io/u/Larryc)\
**Post date:** [September 2, 2018, 8:34pm UTC](https://discourse.chef.io/t/error-nomethoderror-undefined-method-windows-zipfile/13562/2 "2018-09-02T20:34:40Z")

</div>

You could use the execute resource along with the 7zip command line parameters

[https://sevenzip.osdn.jp/chm/cmdline/commands/extract.htm](https://sevenzip.osdn.jp/chm/cmdline/commands/extract.htm)

[https://docs.chef.io/resource\_execute.html](https://docs.chef.io/resource_execute.html)

---

<div class="post-metadata">

**Author:** ![deepaksingla](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/deepaksingla/32/2321_2.png) [@deepaksingla](https://discourse.chef.io/u/deepaksingla)\
**Post date:** [September 3, 2018, 4:04am UTC](https://discourse.chef.io/t/error-nomethoderror-undefined-method-windows-zipfile/13562/3 "2018-09-03T04:04:06Z")

</div>

Once again thanks Larryc

---

<div class="post-metadata">

**Author:** ![RADITC](https://avatars.discourse-cdn.com/v4/letter/r/3be4f8/32.png) [@RADITC](https://discourse.chef.io/u/RADITC)\
**Post date:** [September 3, 2018, 11:00am UTC](https://discourse.chef.io/t/error-nomethoderror-undefined-method-windows-zipfile/13562/4 "2018-09-03T11:00:38Z")

</div>

Currently, I do this. It's simple and effective

```
log 'Fetch binaries from repo - Start'
remote_file "Fetch the zip file" do
  path File.join(node['w2k12_oracleclient_11g'][packageAlias]['oracledir'], node['w2k12_oracleclient_11g'][packageAlias]['zip'])
  source File.join(node['w2k12_oracleclient_11g'][packageAlias]['repo_path'], node['w2k12_oracleclient_11g'][packageAlias]['zip'])
  action :create_if_missing
end
log 'Fetch binaries from repo - End'

log 'Extracting the package - Start'
execute 'Extract the downloaded package' do
  cwd "#{oracle_path}"
  command "tar -xvf #{package_name}"
  action :run
  end
log 'Extracting the package - End'

log 'Delete the zipfile - Start'
execute 'Delete zip file' do 
  cwd "#{oracle_path}"
  command "del /Q #{package_name}"
  action :run
end
log 'Delete the zipfile - End'
```
