# Error in windows cookbook in windows platform

**URL:** <https://discourse.chef.io/t/error-in-windows-cookbook-in-windows-platform/5385>\
**Category:** Chef Infra (archive)\
**Created:** [May 9, 2014, 6:02am UTC](https://discourse.chef.io/t/error-in-windows-cookbook-in-windows-platform/5385 "2014-05-09T06:02:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ganesan\_A](https://avatars.discourse-cdn.com/v4/letter/g/f07891/32.png) [@Ganesan\_A](https://discourse.chef.io/u/Ganesan_A)\
**Post date:** [May 9, 2014, 6:02am UTC](https://discourse.chef.io/t/error-in-windows-cookbook-in-windows-platform/5385/1 "2014-05-09T06:02:07Z")

</div>

hi,

i developed cookbook with chef windows resources like windows\_batch,  
windows\_zip and etc. With the help of windows cookbook my cookbook was  
executed.  
some code in my cookbook like

windows\_batch “get latest from TFS” do  
cwd node[‘tfsscript\_path’]  
code \<\<-EOH  
tfsSchedule.exe  
EOH  
end  
windows\_zipfile “extract current deployment” do  
source node[‘dest\_currentDeploymentzip’]  
action :unzip  
path node[‘extract\_currentDeploymentcode’]  
not\_if {::File.exists?(node[‘extract\_currentDeploymentcode’])}  
end

previously it was working fine but suddenly its shows error like below…

## NoMethodError

No resource or method named `windows_zipfile' for`Chef::Recipe “bitrefresh”’

No resource or method named `windows_batch' for`Chef::Recipe “bitrefresh”’

iam using hosted chef env and dependency cookbooks like windows, powershell and  
chef\_handler for my own cookbook, Idont know how to resolve this??

Please share details hoe to resolve this…? Thanks in advance!!!

Regards,  
Ganesan.A

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [May 9, 2014, 3:30pm UTC](https://discourse.chef.io/t/error-in-windows-cookbook-in-windows-platform/5385/2 "2014-05-09T15:30:27Z")

</div>

On Thursday, May 8, 2014 at 11:02 PM, [ganesan15785@gmail.com](mailto:ganesan15785@gmail.com) wrote:

> hi,
> 
> i developed cookbook with chef windows resources like windows\_batch,  
> windows\_zip and etc. With the help of windows cookbook my cookbook was  
> executed.  
> some code in my cookbook like
> 
> windows\_batch "get latest from TFS" do  
> cwd node['tfsscript\_path']  
> code \<\<-EOH  
> tfsSchedule.exe  
> EOH  
> end  
> windows\_zipfile "extract current deployment" do  
> source node['dest\_currentDeploymentzip']  
> action :unzip  
> path node['extract\_currentDeploymentcode']  
> not\_if {::File.exists?(node['extract\_currentDeploymentcode'])}  
> end
> 
> previously it was working fine but suddenly its shows error like below...
> 
> ## NoMethodError
> 
> No resource or method named `windows_zipfile' for `Chef::Recipe "bitrefresh"'
> 
> No resource or method named `windows_batch' for `Chef::Recipe "bitrefresh"'
> 
> iam using hosted chef env and dependency cookbooks like windows, powershell and  
> chef\_handler for my own cookbook, Idont know how to resolve this??
> 
> Please share details hoe to resolve this...? Thanks in advance!!!!
> 
> Regards,  
> Ganesan.A

I would guess that your cookbook isn’t specifying a dependency on the windows cookbook. You’ll want to add a `depends` statement. [http://docs.opscode.com/essentials\_cookbook\_metadata.html](http://docs.opscode.com/essentials_cookbook_metadata.html)

--  
Daniel DeLeo
